Skip to content

Instantly share code, notes, and snippets.

View mfpiccolo's full-sized avatar

Mike Piccolo mfpiccolo

View GitHub Profile
this is a test_file to give us an extra file to use
@mfpiccolo
mfpiccolo / gist:5210229
Created March 21, 2013 02:21
Run a query on
require 'faraday'
require 'base64'
require 'json'
first = "Sample"
last = "Name"
email = "sample"
urlencoded = URI.encode_www_form({'first' => first, 'last' => last, 'email' => email})
api_key = 'f464931b7e4b8f00cfbff0dc95f73756'
@mfpiccolo
mfpiccolo / eventbrite_search.rb
Last active November 17, 2016 04:38
Eventbrite api search request
require 'faraday'
require 'base64'
require 'json'
latitude = '37.77493'
longitude = '-122.419415'
api_key = 'O5EE3I72DNW2VXUOTH'
max = '3'
date = 'This week'
city = "Chicago"
@mfpiccolo
mfpiccolo / edit.coffee
Created May 16, 2013 07:00
This is my attempt at fixing the reload problem after submitting a rename update.
jQuery ->
$("#modal-wrap").html("""<%= escape_javascript(render "account/events/edit", event: @event, product: @product) %>""")
$("#modal").trigger("reveal:close")
$("#modal").click(location.reload())
@mfpiccolo
mfpiccolo / gist:5616288
Created May 20, 2013 23:04
subl config
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".tags*",
"*.pyc",
@mfpiccolo
mfpiccolo / gist:5733236
Last active December 18, 2015 05:29
Benchmark to test OpenStruct preformance
require "./mini_struct"
require "ostruct"
require "benchmark"
o_time = Benchmark.measure do
500_000.times do |num|
os = OpenStruct.new(id: num)
os.x = "xyz"
os.y = 4
os.x = "lmn"
@mfpiccolo
mfpiccolo / draggables.js.coffee
Created July 30, 2013 09:53
Build draggables js object
draggables = {}
jQuery.each jQuery(".ui-draggable"), (index, draggable) ->
draggable = jQuery(this)
child = draggable.children()
value = child.val()
classes = draggable.attr("class").replace(/ui-draggable|down|cloner/, "").replace(/ui-draggable|down|cloner/, "").replace(/ui-draggable|down|cloner/, "")
offset = draggable.offset()
left = offset.left
top = offset.top
@mfpiccolo
mfpiccolo / post-commit
Created August 6, 2013 20:39
Post Commit - Mike edit
#!/bin/sh
d=`date`
message=`git log -1 HEAD --format=format:%s`
branch=`git rev-parse --abbrev-ref HEAD`
echo "Added: "${d},${PWD##*/},${branch},${message}" to ~/commits/commits.csv"
`echo ${d},${PWD##*/},${branch},${message} >> ~/commits/commits.csv`
# You must run both of these in each dir you want the script to run:
@mfpiccolo
mfpiccolo / post-commit
Created August 6, 2013 20:40
Post Commit - Phil edit
#!/bin/sh
message=`git log -1 HEAD --format=format:%s`
branch=`git rev-parse --abbrev-ref HEAD`
data="`date`,${PWD##*/},${branch},${message}"
commit_log="~/commits/commits.csv"
echo $data >> $commit_log
echo "Added: $data to $commit_log"
@mfpiccolo
mfpiccolo / turn_around_report.rake
Last active December 21, 2015 18:09
This generates a csv with turn around time for requests by month and shows monthly turn around time for each issue type
namespace :report do
task turn_around: :environment do
month = Date.new(2012,01,25) # Date GenieDocs v1.0 launched.
rows = []
request_issue_types = [
"Request/Authorization", "Request/Certificate of No Records", "Request/Legal",
"Request/Standard", "Request/Verification", "Request/Verify SS and/or DOB",
"Request/Required Location Info", "Request/Duplicate"
]