Skip to content

Instantly share code, notes, and snippets.

@dcluna
dcluna / gist:2147164
Created March 21, 2012 14:10 — forked from fogus/gist:2124742
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@dcluna
dcluna / Gemfile
Created June 19, 2012 20:01 — forked from BrianTheCoder/Gemfile
an example of full text search in postgres using datamapper
source "http://gems.github.com"
source "http://gemcutter.org"
bundle_path "gems"
gem "dm-core"
gem "dm-migrations"
gem "dm-sweatshop"
gem "data_objects"
gem "do_postgres"
@dcluna
dcluna / raskell.rb
Created August 21, 2012 18:16 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@dcluna
dcluna / ideavimrc
Last active August 29, 2015 14:16 — forked from RobertAudi/ideavimrc
.ideamvimrc remapping copy actions to use the system clipboard
nnoremap yy "+yy
vnoremap y "+y
nnoremap p "+p
vnoremap p "+p
nnoremap P "+P
vnoremap P "+P
@dcluna
dcluna / Material Design Colors
Last active August 29, 2015 14:16 — forked from cypressious/Material Design Colors
Android Google colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@dcluna
dcluna / gist:58c8ba5137fe665ca3ad
Last active August 29, 2015 14:17 — forked from esoergel/gist:782725cd6c8956fc9d21
hammer function for commcare-hq
function hammer() {
git checkout master
git pull origin master
git submodule update --init --recursive
pip install -r requirements/requirements.txt -r requirements/dev-requirements.txt -r ⤷ requirements/prod-requirements.txt
find . -name '*.pyc' -delete
./manage.py syncdb --migrate
}
@dcluna
dcluna / giffify.sh
Last active August 29, 2015 14:25 — forked from rock3r/giffify.py
Giffify - easily create optimised GIFs from a video
#!/bin/sh
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# ----------------------------------------------------------------------------
#
# Based upon http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
@dcluna
dcluna / capybara cheat sheet
Created November 19, 2015 18:27 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@dcluna
dcluna / cf-invalidate.php
Created January 25, 2016 18:29 — forked from claylo/cf-invalidate.php
How to invalidate items in AWS CloudFront
<?php
/**
* Super-simple AWS CloudFront Invalidation Script
*
* Steps:
* 1. Set your AWS access_key
* 2. Set your AWS secret_key
* 3. Set your CloudFront Distribution ID
* 4. Define the batch of paths to invalidate
* 5. Run it on the command-line with: php cf-invalidate.php
@dcluna
dcluna / tracking_interceptor.md
Created April 5, 2016 18:01 — forked from gampleman/tracking_interceptor.md
Adding tracking to emails in Rails

This gist illustrates how you would add Google Analytics tracking into your Rails mailers. Add the tracking_interceptor.rb into your path and enable it for your mailers with:

register_interceptor TrackingInterceptor