Instantly share code, notes, and snippets.

ffmpeg -i -profile:v high -level 4.1 -movflags +faststart -vcodec libx264 -r 24 -s 1280x720 -preset slow -crf 24 -acodec libfaac -ac 2 -ab 128k -threads 4 -tune zerolatency output.mp4
until [ $? -eq 0 ]; do curl -I --fail; done
View Corrupcion-IHSS.txt
Febrero 2010
Junio 2010
Agosto 2010
Enero 2011
View playbook.yml
- hosts: localhost
- name: ensure Git is installed
apt: pkg=git state=present
- name: ensure Nginx is installed
apt: pkg=nginx state=present
- name: ensure Monit is installed
apt: pkg=monit state=present
View honduras_municipios.rb
department = Departamento.create(:name=>"ATLANTIDA",:num=>1)
Municipio.create(:name=>"LA CEIBA",:num=>1,:departamento_id=>
Municipio.create(:name=>"EL PORVENIR",:num=>2,:departamento_id=>
Municipio.create(:name=>"LA MASICA",:num=>5,:departamento_id=>
Municipio.create(:name=>"SAN FRANCISCO",:num=>6,:departamento_id=>
department = Departamento.create(:name=>"COLON",:num=>2)
#!/usr/bin/env bash
apt-get -y update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
curl -L | bash
source /etc/profile.d/
rvm requirements
rvm install 2.0.0
source /etc/profile.d/
gem install chef ruby-shadow --no-ri --no-rdoc
View spherical_point_at_distance.rb
def point_at_distance(center, distance, bearing=180)
pi = Math::PI
r_e = 6378137.0 #meters
d = distance/r_e
lat1 = (pi/180) * center.latitude
lng1 = (pi/180) * center.longitude
tc = (pi/180) * bearing
y = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc))
View circle_path
def self.circle_path(center, radius, complete_path = false)
# For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below:
r_e = 6378137.0
@@d2r ||= Math::PI/180
@@multipliers ||= begin
segments = 16
dRad = 2*Math::PI/segments
(segments + (complete_path ? 1 : 0)) do |i|
rads = dRad*i
y = Math.sin(rads)
View buy.js
//you will need to install node.js and restler first
//npm install restler
//run with the following command
// node buy.js
var sys = require('util'),
rest = require('restler');
//set these to your coinbase API key, the amount you want to buy & the price that you're expecting for
View price_check.rb
require 'nokogiri'
require 'open-uri'
require 'terminal-notifier'
title = 'Bitcoin Gem'
activate = 'com.googlecode.iterm2'
current_price = 0
while 1