Jeffry Degrande jeffrydegrande

View gist:3852695
1 2 3 4 5 6 7 8 9 10
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
View project-web-reload.conf
1 2 3 4 5 6 7 8
# /etc/init/project-web-reload.conf
 
pre-start script
initctl restart project-web
sleep 15
end script
 
exec /usr/local/rvm/bin/default_bluepill restart
View clojure.clj
1 2 3 4 5 6 7 8 9 10
; a quick attempt at doing the same thing in clojure could for example something like
 
(defpartial input [name]
[:tr
[:td
[:input {:name name}]]])
 
(defpartial edit-task-form [& inputs]
[:div.generic.lightbox
[:table
View gist:3167612
1 2 3 4 5 6 7 8 9 10
#chart
 
- content_for :bottom do
:javascript
$(function() {
chart: { renderTo: 'chart',
type: "column" },
title: { text: "Errors per Site" },
xAxis: {
title: { text: null },
View gist:3146336
1 2 3 4 5 6 7 8
fill = (what, {with, of}) ->
container = what ?= "mug"
quantity = with ?= "500 mL"
liquid = of ?= "coffee"
alert("#{quantity} of #{liquid} on my #{container} plz")
 
 
fill "cup", with: "400ml", of: "cachaça"
View gist:2898729
1 2 3 4 5 6 7 8 9 10
# So .. if I really need to have different behavior
# based on gender ...
class Male < Person
end
 
class Female < Person
end
 
 
FactoryGirl.define do
View Event.cs
1 2 3 4 5 6 7 8 9 10
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public class Event
{
private DateTime date;
 
[JsonProperty("name")]
public string Name { get; set; }
View gist:2323857
1 2 3 4 5 6 7 8 9 10
(function() {
Thing = {};
 
Thing.findAll = function(callback) {
$.getJSON('/things', function(data) {
if (data!=null) {
callback(data);
}
});
}
View setup-statsd.sh
1 2 3 4 5 6 7 8 9 10
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
View gist:2153019
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
set -e
 
VERSION="1.9.2-p290"
 
# build dependencies
 
sudo apt-get install libssl-dev
sudo gem install fpm
Something went wrong with that request. Please try again.