Skip to content

Instantly share code, notes, and snippets.

@helenb
helenb / gist:07d19a5cda7b7f02d605756fcd064819
Created June 21, 2017 13:09
find all methods on an object in django
print(dir(object))
git merge --abort
git branch —no-merged
@helenb
helenb / centre.css
Created January 16, 2017 08:13
CSS Centre positioning
.test {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
@helenb
helenb / multiple-transition-declaration.css
Created January 16, 2017 08:10
Multiple transition declaration example
.test {
width: 200px;
height: 50px;
background-color: seagreen;
border: 3px solid darken(seagreen, 10%);
border-radius: 5px;
transition: background 2s linear, border 2s ease-out;
}
.test:hover {
@helenb
helenb / _hidden.scss
Created November 24, 2016 08:11
Accessible hidden text
// Accessible hidden text
@mixin hidden {
position: absolute;
left: -99999999px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
@helenb
helenb / dialgogue.js
Created May 4, 2016 07:24
show / hide a dialogue - close by clicking anywhere on the page
//function version:
function showHideDialogue() {
$('.share').click(function( e ) {
e.preventDefault();
e.stopPropagation();
if($('.dialogue').hasClass('expanded')) {
$('.dialogue').removeClass('expanded');
$('.dialogue').slideUp();
} else {
@helenb
helenb / gist:6e69a2c119ac44b88f85a14105d4a9f4
Created May 4, 2016 07:19
Low specificity selector to get all but the first items a list
li + li {}
@helenb
helenb / gist:81236d857174738749882eb9ec10a0f6
Last active April 27, 2016 08:56
Git command to see who has contributed most to a project
git shortlog -sn
@helenb
helenb / gist:7649b5ff18b6ece744c7df952c39d95d
Created April 27, 2016 08:54
Command to find out what's happening with local ports and vagrant
VBoxManage list runningvms -l | grep "host port"`