Skip to content

Instantly share code, notes, and snippets.

View tyrel86's full-sized avatar

Tyrel Richey tyrel86

View GitHub Profile
@tyrel86
tyrel86 / implementation
Created May 19, 2014 19:00
Sunlight API access
s = Sunlight::UrlGenerator.new("inventory/904655", {format: "json"})
At this test run the URL evaulated to https://services.sunlightsupply.com/v1/inventory/904655?format=json&X-ApiKey=gMgF47gaFdncTcE2GLoTEdmAcXHWakNXyKdPZjKSoiMAWgWLCR&time=2014-05-19T18:59:49Z&signature=113295BAAD176C82CD09127F7CB5E4135B995FA1
I got an invalid signature
#!/usr/bin/ruby
# This script acts as a command-line filter to convert a BSON file (such as from mongodump) to an equivalent JSON file
# The resulting JSON file will be an array of hashes
# Any binary values from the BSON file are converted to base64 (such as Mongo's _id fields)
# I originally wrote this script so that Mongo files can be easily used with jsawk for
# offline data processing -- https://github.com/micha/jsawk
#
# To invoke, assuming mycollection.bson is a file from mongodump:
# ruby bson2json.rb < mycollection.bson > mycollection.json
@tyrel86
tyrel86 / gist:5167688
Created March 15, 2013 05:33
Leaflet js
$(document).ready( function() {
var user_location = $('user_location')
var user_lat = parseFloat(user_location.data('lat'))
var user_lng = parseFloat(user_location.data('lng'))
var map;
var markers = [];
if($("#map").size() > 0) {
map = L.map('map').setView( [user_lat, user_lng], 11 )
@tyrel86
tyrel86 / gist:5146499
Created March 12, 2013 20:05
Bundler ZenTest Clash of the Titens
gem update --system
gem install bundler
bundle install
@tyrel86
tyrel86 / adilas.rb
Created October 17, 2012 02:01
Adilas Ruby Helper
class AdilasHelper
def initialize( corperate_key )
@key = corperate_key
@client = Savon.client("http://www.adilaswebservices.biz/inventory/webComponents/adilasWeb.cfc?wsdl")
@live_menu = requestLiveMenu
end
def request( action_as_sym, params = {} )
params[:corp_key_id] = @key
@tyrel86
tyrel86 / gist:3244540
Created August 3, 2012 05:00
net stat
root@ID12103:/home/CannaPages# netstat -pln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 787/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4969/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 734/sshd
tcp6 0 0 :::22 :::* LISTEN 734/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 1548 787/mysqld /var/run/mysqld/mysqld.sock
@tyrel86
tyrel86 / gist:3244508
Created August 3, 2012 04:54
unicron.rb
worker_processes 4
working_directory "/home/CannaPages/"
# This loads the application in the master process before forking
# worker processes
# Read more about it here:
# http://unicorn.bogomips.org/Unicorn/Configurator.html
preload_app true
timeout 30
@tyrel86
tyrel86 / gist:3244486
Created August 3, 2012 04:53
nginx conf
worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
# Set this to on if you have more than 1 working processes
# This will allow only one child to watch the pollset and accept
@tyrel86
tyrel86 / gist:3130606
Created July 17, 2012 17:02
mod rails vs
<VirtualHost *:80>
ServerName www.bigaviation.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /aviation/public
RailsSpawnMethod smart
PassengerPoolIdleTime 1000
RailsAppSpawnerIdleTime 0
PassengerMaxRequests 5000
PassengerMinInstances 3
<Directory /aviation/public>
@tyrel86
tyrel86 / gist:2943535
Created June 17, 2012 05:44
apache advise
*** tyrel86 [~463906b1@li114-241.members.linode.com] has joined #linode
*** Topic is: Linode Community Support | http://www.linode.com/ | Linode Birthday Giveaway! - http://bit.ly/LVZ36y
*** Topic set by ChanServ!services@services.oftc.net [Sat Jun 16 19:27:26 2012]
*** tyrel86 cnasal NateCup MagiC3PO pharaun Defenestrator Nemykal danblack choonming Austinh100 KHobbits_ Dreamer3 brambles tparker eyepulp gadams|away NdFeB lsabota sandeep wrf Daevien jeremyb @restelow Lydia JshWright staticsafe rsdehart tacticus encode dopey_ dan64 nenolod monokrome ekes ChatLeper solipsist minerale G jacob Pici thegodlikehobo EugeneKay Aka danieldg jonas__ WindPower @deaton Badgerer rasengan @stan_theman bss peper avenj Hydroxide eblack lkb_ array
*** auraka dhunter tharkun darkex Peng Eman_ randallman jvaughan_ bradoaks warewolf HalJorda1 scorche|1h eronel jtsage BlandSauce gmcharlt u3q jchen JDLSpeedy vinic ghostbar elky cooldude Drone4four waltman bmn vervain aziwoqpd Sputnik7 rmayorga Justasic pjkh HockeyInJune Chris___ si