Skip to content

Instantly share code, notes, and snippets.

View dgilperez's full-sized avatar
🌊
Build that!

David Gil dgilperez

🌊
Build that!
View GitHub Profile
@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@seyhunak
seyhunak / app
Last active December 31, 2015 05:49
Varnish - Nginx - Unicorn Setup
upstream unicorn {
server unix:/tmp/unicorn.app.sock fail_timeout=0;
}
# HTTP server
#
server {
listen localhost:8080;
server_name app.me;
@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0
@mono0926
mono0926 / ipdb.md
Created August 24, 2013 04:12
Debugging with ipython and ipdb
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@dgilperez
dgilperez / README_Genealogy.textile
Last active December 17, 2015 12:49
Resources towards an online genealogical tree visualizing app
@krisf
krisf / enc
Last active August 13, 2022 00:02
decrypts OpenSSL encrypted files from ruby Backup gem
#!/bin/bash
#encrypt files with aes-256-cbc cipher using openssl
#install:
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc
# sudo chmod +x /usr/bin/enc
# enc --help
#encrypt files
if [ $1 == "-e" ];
then
@nateberkopec
nateberkopec / delayed_job.rb
Created April 12, 2013 01:42
Comparison of top 3 Ruby background job systems on Ruby Toolbox
# DelayedJob
@user.delay.activate!(@device) # Delay any object
Notifier.delay.signup(@user) # Delay ActionMailer
#DelayedJob supports a number of ways to make methods async
def send_mailer
# Some other code
end
handle_asynchronously :send_mailer, :priority => 20
@tlowrimore
tlowrimore / union_scope.rb
Last active January 13, 2023 21:12
Unions multiple scopes on a model, and returns an instance of ActiveRecord::Relation.
module ActiveRecord::UnionScope
def self.included(base)
base.send :extend, ClassMethods
end
module ClassMethods
def union_scope(*scopes)
id_column = "#{table_name}.#{primary_key}"
sub_query = scopes.map { |s| s.select(id_column).to_sql }.join(" UNION ")
where "#{id_column} IN (#{sub_query})"
@ankane
ankane / README.md
Last active December 14, 2015 03:39 — forked from panthomakos/benchmark.rb

Benchmark Bundler

Because loading gems can take longer than you think

Now available as a gem - get it here