Skip to content

Instantly share code, notes, and snippets.

View reconbot's full-sized avatar
🏴‍☠️
Building at @github

Francis Gulotta reconbot

🏴‍☠️
Building at @github
View GitHub Profile
@reconbot
reconbot / gist:3444898
Created August 24, 2012 02:34
npm errors!
npm ERR! publish Error sending version data
npm ERR! Error: login error
npm ERR! at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:80:22)
npm ERR! at CouchLogin.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/couch-login/couch-login.js:109:46)
npm ERR! at Request.init.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/main.js:120:22)
npm ERR! at Request.EventEmitter.emit (events.js:91:17)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:648:16)
npm ERR! at Request.EventEmitter.emit (events.js:115:20)
npm ERR! at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/local/lib/node_modules/npm/node_modules/request/main.js:610:14)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:115:20)
@reconbot
reconbot / gist:3811831
Created October 1, 2012 13:34
Module Methods via Reflection
module Routes
def home
#stuff
end
def work
#end
end
end
@reconbot
reconbot / entity.rb
Created November 9, 2012 17:50
Self Referential Model
class Entity
include MongoMapper::Document
safe
before_destroy :remove_relations
key :relation_ids, Array
key :name, String
many :relations, :in => :relation_ids, :class => Entity
@reconbot
reconbot / html_escape_json_helper.rb
Created April 15, 2013 15:44
until the built in json_escape is worthwhile https://github.com/rails/rails/pull/6094
def html_escape_json(json_string)
unsafe_chars = {
'<' => '\\u003c',
'>' => '\\u003e',
'&' => '\\u0026',
'=' => '\\u003d',
'\'' => '\\u0027'
}
unsafe_regex = /[<>&=']/
unless json_string.is_a?(String)
@reconbot
reconbot / test.php
Last active December 18, 2015 10:09
example php array to json
<?php
$foo = Array();
$foo["ewe"] = "Bob!\nHow are you?";
$foo[4] = 5;
$foo["break"] = "</script>";
# omg use templates
echo "<script>\n";
echo "var globals = ", json_encode($foo), ";\n";
@reconbot
reconbot / gist:5786475
Created June 15, 2013 02:02
RWLDN's Xbee Configs
Programmer
System Information
Version Info (ATVR): 10EC
Baud Rate (ATBD): 6
PAN ID (unique device id) (ATID): 1234
Networking Source Address (ATMY): 0
Networking Destination Address (ATDL): FFFF
Digital I/O Config Pin 3 (ATD3): 3
var buttonActive = false;
var toggleButton = function(){
buttonActive = !buttonActive;
if (buttonActive) {
$(".nco-alert").show();
$(".ticketed-alert").hide();
// $(".unticketed-alert").show();
} else {
$("#all-btn").removeClass("active");
$(".nco-alert").hide();
"It comes from a very ancient democracy, you see..."
"You mean, it comes from a world of lizards?"
"No," said Ford, who by this time was a little more rational and coherent than he had been, having finally had the coffee
forced down him, "nothing so simple. Nothing anything like to straightforward. On its world, the people are people. The
leaders are lizards. The people hate the lizards and the lizards rule the people."
"Odd," said Arthur, "I thought you said it was a democracy."
get '/data/:source' do |source|
data = get_data_from_db_or_something(source)
header :content_type, :application_json
data.to_json
end
get '/'
Project: LevoLeague.com
Codename: Airwolf
Team:
- Brenda Storer
- Eric Collins
- Francis Gulotta
- Rushaine McBean
- Sara J Chipps
- Scott Reynolds
- Timothy "Teej" Mac Blane