Skip to content

Instantly share code, notes, and snippets.

View nhocki's full-sized avatar
💭
I may be slow to respond.

Nicolás Hock-Isaza nhocki

💭
I may be slow to respond.
View GitHub Profile
@nhocki
nhocki / config.ini
Created September 4, 2022 02:15 — forked from orendon/config.ini
Visa appointment (renewal)
[USVISA]
; Account and current appointment info from https://ais.usvisa-info.com
USERNAME = YOUR_EMAIL
PASSWORD = YOUR_PASSWORD
SCHEDULE_ID = YOUR_ID
MY_SCHEDULE_DATE = YYYY-MM-DD
; Spanish - Colombia
COUNTRY_CODE = es-co
; Bogotá
FACILITY_ID = 26
@nhocki
nhocki / introrx.md
Created May 9, 2016 22:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@nhocki
nhocki / hack.sh
Created November 7, 2013 03:21 — forked from wm/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nhocki
nhocki / uri.js
Created September 6, 2012 03:47 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@nhocki
nhocki / installation.sh
Created January 4, 2012 03:12 — forked from mikhailov/installation.sh
Nginx+passenger application config: ssl redirection, http headers, passenger optimal settings. see details: http://mikhailov.posterous.com/nginx
$ cd /usr/src
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz
$ tar xzvf ./nginx-0.8.52.tar.gz
$ rm ./nginx-0.8.52.tar.gz
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc
$ passenger-install-nginx-module
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52
# Where do you want to install Nginx to?: /opt/nginx
@nhocki
nhocki / caveatPatchor.js
Created September 6, 2011 17:21 — forked from dstrelau/caveatPatchor.js
caveatPatchor.js file for use in Propane
var displayAvatars = true;
var displayCloudAppImages = true;
var displayGists = true;
if (displayAvatars) {
Object.extend(Campfire.Message.prototype, {
addAvatar: function() {
if (this.actsLikeTextMessage()) {
var author = this.authorElement();
@nhocki
nhocki / s3_transfer.rb
Created August 3, 2011 06:06
Transfer PaperClip attachment files from S3 to the filesystem
@base = File.join(Rails.root, "public/system/attachments/#{Rails.env}/")
# model: Class
# method: :symbol
# eg transfer(Image, :file)
def transfer(model, method)
dummy = model.new.send(method)
styles = [nil] + dummy.styles.keys
model.all.each do |obj|
styles.each do |style|
@nhocki
nhocki / gist:1095522
Created July 20, 2011 18:11 — forked from croaky/gist:1089598
Transfer data from production to staging on Heroku
heroku addons:add pgbackups --remote staging
heroku addons:add pgbackups --remote production
heroku pgbackups:capture --remote production
heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging
@nhocki
nhocki / rvm(ree and system)-nginx-unicorn.sh
Created June 20, 2011 19:04
linode stack script to setup a headless ubuntu linode w/ RVM, MySQL, Nginx, and Unicorn
#!/bin/bash
#<udf name="hostname" label="System Host Name">
#<udf name="adminuser" default="admin" label="Admin user name">
#<udf name="adminpassword" label="Admin user password">
#<udf name="deployuser" default="deploy" label="Deploy user name">
#<udf name="deploypassword" label="Deploy user password">
#<udf name="mysql_password" label="MySQL Password">
source <ssinclude StackScriptID=1>
@nhocki
nhocki / README.md
Created June 20, 2011 19:02 — forked from jpantuso/README.md
Deploying Rails to Linode

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup