Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Oh hai</title>
<style>
html { width: 100% }
body {
width: 600px; margin: auto;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
@jdcantrell
jdcantrell / css_critic_test_generator.rb
Last active August 29, 2015 14:01
Example plugin for Hologram. This generates the needed files to run csscritic against your style examples.
class CssTestGenerator < Hologram::Plugin
attr :output_dir, :tests
HTML_HEADER = <<-eos
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/build/css/screen.css">
@jdcantrell
jdcantrell / init.el
Created August 13, 2014 00:10
My attempt at emacs
;;; init.el --- where all the magic begins
;;
;; turn off mouse interface early in startup to avoid momentary display
;; you really don't need these; trust me.
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;; load path etc.
@jdcantrell
jdcantrell / gist:91bce12d3cd4c69239db
Last active August 29, 2015 14:05
Almost all pygments supported file extensions comma separated.
'.croc', '.dg', '.factor', '.fy', '.fancypack', '.io', '.lua', '.wlua',
'.md', '.moon', '.pl', '.pm', '.py3tb', '.py', '.pyw', '.sc',
'SConstruct', 'SConscript', '.tac', '.sage', '.pytb', '.rb', '.rbw',
'Rakefile', '.rake', '.gemspec', '.rbx', '.duby', '.tcl', '.c-objdump',
'.s', '.cpp-objdump', '.c++-objdump', '.cxx-objdump', '.d-objdump',
'.s', '.S', '.ll', '.asm', '.ASM', '.objdump', '.adb', '.ads', '.ada',
'.bmx', '.c', '.h', '.idc', '.cbl', '.CBL', '.cob', '.COB', '.cpy',
'.CPY', '.cpp', '.hpp', '.c++', '.h++', '.cc', '.hh', '.cxx', '.hxx',
'.C', '.H', '.cp', '.CPP', '.cu', '.cuh', '.pyx', '.pxd', '.pxi', '.d',
'.di', '.pas', '.dylan-console', '.dylan', '.dyl', '.intr', '.lid',
function watchtest () {
watchmedo shell-command -W -p "./$1/*;./tests/$1/*" -R -c "phpunit --config tests/phpunit_local.xml tests/$1"
}
@jdcantrell
jdcantrell / Guardfile
Created December 8, 2011 18:53
Base Guardfile for local dev on FeDev
# Add files and commands to this file, like the example:
# watch('file/path') { `command(s)` }
#
#
$username = 'jcantrell';
guard 'shell' do
def sync(from, to)
system("rsync -avz ./#{from}/ #{$username}@fedev.utah.trulia.com:#{to}/ --exclude '.svn'")
@jdcantrell
jdcantrell / Guardfile.rb
Created February 6, 2012 22:28
FeDev Guard (better)
# Add files and commands to this file, like the example:
# watch('file/path') { `command(s)` }
#
#
$username = 'jcantrell'
guard :shell do
$last_call = Time.now
Notifier.turn_on
@jdcantrell
jdcantrell / gist:2231240
Created March 28, 2012 22:46
svn diff alias
alias sd="svn st | cut -c8- | sed -e '/local.conf/d' -e '/.htaccess/d' -e '/site.conf/d' | xargs svn diff | colordiff | less -R"
@jdcantrell
jdcantrell / .jshintrc
Created April 10, 2012 22:55
JSHint settings
{
"browser": true,
"jquery": true,
"indent": 2,
"white": true,
"curly": true,
"forin": true,
"noarg": true,
"immed": true,
"newcap": true,
@jdcantrell
jdcantrell / local-dev.conf
Created October 7, 2013 06:53
This is part of my solution to replicate pow(ruby script)/anvil(osx app) on linux. You can symlink folders to ~/.sites/blarg and then view content in the browser by going to blarg.dev. If you're using ruby or python you can also startup an app server(unicorn/gunicorn/others) listening to 8080. I use dnsmasq to send all *.dev domains to localhost.
upstream app_server {
server localhost:8080 fail_timeout=0;
}
server {
listen 80;
server_name "~^(?<base_dir>.+)\.dev$";
access_log /var/log/nginx/dev.access.log main;
error_log /var/log/nginx/dev.error.log;