Skip to content

Instantly share code, notes, and snippets.

View jwdeane's full-sized avatar

James Deane jwdeane

View GitHub Profile
---
extension: xml
layout: nil
filter:
- erb
---
<% pages = @pages.find(:limit => 10,
:in_directory => 'posts',
:sort_by => 'created_at',
:reverse => true) -%>
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@dlutzy
dlutzy / gist:2469037
Created April 23, 2012 05:59
Multi VM Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]
@jcromartie
jcromartie / tables.js
Created June 14, 2012 17:01
Backbone views done right done right?
var TableViewRow = Backbone.View.extend({
tagName: "tr",
template: _.template("<td><%= firstName %></td><td><%= lastName %></td>"),
render: function() {
this.$el.html(this.template(this.model.toJSON()));
return this;
}
});
@rdingwall
rdingwall / teamcity_reporter.html
Created June 17, 2012 19:15
Jasmine PhantomJS event based exit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Console Reporter Spec</title>
<link rel="stylesheet" href="../ext/jasmine.css" type="text/css" />
<script type="text/javascript" src="../ext/jasmine.js"></script>
<script type="text/javascript" src="../ext/jasmine-html.js"></script>
@orderedlist
orderedlist / labels.scss
Created July 9, 2012 18:42
Simple Label Colors with SCSS
$start-color:#2B73A2;
$number: 12;
@for $i from 1 through $number {
.label-#{$i} {
color:adjust_hue($start-color, ($i - 1) * (360 / $number));
}
}
@mislav
mislav / _readme.md
Last active September 28, 2024 23:03
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@parhamr
parhamr / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Last active October 13, 2023 14:20
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.
@rachelandrew
rachelandrew / default.vcl
Created July 26, 2015 15:38
Varnish VCL example
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
vcl 4.0;
backend default {
.host = "127.0.0.1";