Skip to content

Instantly share code, notes, and snippets.

View nickel's full-sized avatar
🎩

Juan Gallego IV nickel

🎩
View GitHub Profile
function newElement(object_name, method, resource, controller, div, prompt_text){
var name = prompt(prompt_text);
if(name) {
field = object_name + "[name]";
$.post("/" + controller, {'element[name]' : name}, function(response) {
var html = "<select name='" + object_name + "[" + method + "]' id='" + object_name + "_" + method + "'><option value=''/>";
for(var i=0;i<response.length;i++){
html += "<option value='" + response[i][resource].id + "'>" + response[i][resource].name + "</option>"
if(response[i][resource].name == name) {
before "deploy", "deploy:check_revision"
desc "Make sure there is something to deploy"
task :check_revision, :roles => [:web, :app] do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts ""
puts " \033[1;33m**************************************************\033[0m"
puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m"
puts " \033[1;33m**************************************************\033[0m"
puts ""
@nickel
nickel / quotes
Created July 26, 2011 04:31
Get all the Startup Quotes with this simple ruby script
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url_base = "http://startupquote.com/page/"
images_path = File.expand_path(ARGV[0] || "~/Pictures/quotes")
if !File.exists?(images_path)

Keybase proof

I hereby claim:

  • I am nickel on github.
  • I am nickel (https://keybase.io/nickel) on keybase.
  • I have a public key whose fingerprint is A54A E76E B39D CF5E 34D3 3FC1 7C9A 2D7F 3231 4A6C

To claim this, I am signing this object:

@nickel
nickel / 0_reuse_code.js
Created October 16, 2016 15:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console