Skip to content

Instantly share code, notes, and snippets.

View llkats's full-sized avatar
💭
still affable

Lydia Kats llkats

💭
still affable
View GitHub Profile
@llkats
llkats / Twitter Button CSS
Created February 28, 2011 16:25
custom Twitter button function
#custom-tweet-button {
width: 60px;
}
#custom-tweet-button a {
background: url('http://a4.twimg.com/images/favicon.ico') 1px center no-repeat;
border: 1px solid #ccc;
color: #437792;
display: block;
padding: 2px 5px 2px 20px;
text-decoration: none;
@llkats
llkats / IE iframe scrollbar fix
Created March 9, 2011 18:01
Getting rid of scrollbars on an iframe
<html style="overflow-x:hidden"></html>
@llkats
llkats / preventDefaultTernary.js
Created September 21, 2011 19:43
preventDefault for modern browsers and IE
var genericHandler = function(evt) {
evt.preventDefault ? evt.preventDefault() : evt.returnValue = false;
};
@llkats
llkats / addAttachEvents.coffee
Created September 21, 2011 19:44
add/attach event listeners for modern browsers and IE
addListener = (elt, type, fn) ->
if elt.addEventListener then elt.addEventListener(type, fn, false)
else if elt.attachEvent then elt.attachEvent('on' + type, fn)
@llkats
llkats / coffee-debug.coffee
Created October 12, 2011 16:20
console debugging idiom
debug = if console?.log? then true else false
# ... #
console.log "error" if debug
@llkats
llkats / cheatsheet.md
Last active November 26, 2023 06:38
git cheatsheet

git flow feature start <branchname>
starts a new branch

git commit -am "commit message"
make commits as usual

git pull
from master branch, pull in latest changes from the repo (repeat often)

git pull origin <branchname>

@llkats
llkats / gist:1927252
Created February 27, 2012 21:34 — forked from baileylo/gist:1926710
gdgt lunch decider
window.setTimeout(
function() {
(Math.floor(Math.random()*(100)) % 2 ) ? console.log('Chipotle') : console.log('Venue');
},
3600000 // deliberate for an hour before deciding
);
@llkats
llkats / index.css
Created June 18, 2012 21:24
list links in boxes; vertically centered text with one or two lines
li {
display: block;
height: 50px;
line-height: 50px; /* line-height is the same as the height of this element */
text-align: center;
width: 140px;
}
li a {
display: block; /* fills the li */
@llkats
llkats / index.css
Created June 20, 2012 00:21
force borders/padding to be calculated as part of 100% width
nav {
border: 4px solid #333;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding: 0 8px;
width: 100%
}
@llkats
llkats / placeholders.js
Created June 28, 2012 00:40
emulate placeholders in IE9 and other dumb browsers
// test to see if the browser supports native html5 placeholders
jQuery.support.placeholder = (function(){
var i = document.createElement('input');
return 'placeholder' in i;
})();
// if the browser doesn't support placeholders (IE9!!!!!!), do them manually
if (!$.support.placeholder) {
$("input").each(function(){
var current = $(this);