Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile
body {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<style media="screen">
</style>
// jQuery.support.css3
// verifies css3 properties across browsers
// i.e. $.support.css3('transition')
$.support.css3 = function(prop) {
var
support = false,
thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
props = [
{ scopeName = 'source.css';
comment = '';
fileTypes = ( 'css', 'css.erb' );
foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))';
foldingStopMarker = '(?<!\*)\*\*/|^\s*\}';
patterns = (
{ name = 'meta.selector.css';
begin = '^(?=\s*[:.*#a-zA-Z])';
end = '(?=\{)';
patterns = (
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>basic canvas</title>
<style media="screen">
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
}
<html>
<head>
<style type="text/css">
.box {
margin: 5px;
padding: 5px;
background: #D8D5D2;
font-size: 11px;
float: left;
// converts milliseconds to '3:45' or if hours > 0, '2:01:23'
var getTimeFromMillis = function( ms ) {
var seconds = ~~( ( ms / 1000 ) % 60 ),
minutes = ~~( ( ms / ( 1000 * 60 ) ) % 60 ),
hours = ~~( ( ms / ( 1000 * 60 * 60 ) ) ),
twoDigit = function ( n ) {
return n < 10 ? '0' + n : n;
},
seconds = ':' + twoDigit( seconds );
@desandro
desandro / desandro.bash
Created November 29, 2010 15:49
Terminal styles and aliases
# Aliases
alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder"
alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder"
alias myip="echo ethernet:; ipconfig getifaddr en0; echo wireless:; ipconfig getifaddr en1"
alias gitx="open -a GitX ."
alias ohmygit="open .; mate .; gitx"
alias jkas="jekyll --auto --server"
alias rmjkas="rm -rf _site/* && jkas"
alias symlink="ln -s"
@desandro
desandro / jquery.imagesloaded.js
Created January 26, 2011 18:01 — forked from paulirish/README.md
$.fn.imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
@desandro
desandro / phaeton.theme.bash
Created February 10, 2011 14:33
Theme for bash_it
#!/bin/bash
prompt_setter() {
# Save history
history -a
history -c
history -r
# has user and server
# PS1="$(scm_char) [\[$black\]\u\[$reset_color\]@\[$blue\]\h\[$reset_color\]] \[$red\]\w\[$green\]$(scm_prompt_info)$(rvm_version_prompt) \[$yellow\]$\[$reset_color\] "
# no user and seruver