Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile
{ 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 / 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
/**
* Isotope v1.0.110325
* An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co
*
* Commercial use requires one-time license fee
* http://metafizzy.co/#licenses
*
* Copyright 2011 David DeSandro / Metafizzy
*/
@desandro
desandro / rsync.sh
Created June 7, 2011 15:01
basic rsync
# sync up
rsync -rav -e "ssh -l username" /local/path/ server.com:path/
# sync down
rsync -rav -e "ssh -l username" server.com:path/ /local/path/
@desandro
desandro / dabblet.css
Created December 16, 2011 15:04
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
img {
-webkit-transition: all .5s ease;
-webkit-filter: hue-rotate(0);
}
img:hover {
@desandro
desandro / dabblet.css
Created December 16, 2011 15:27
3D perspective inheritance
/* 3D perspective inheritance */
#container {
width: 320px;
height: 50px;
background: blue;
margin-top: 100px;
-webkit-perspective: 800;
-webkit-perspective-origin: 160px 240px;
}