Skip to content

Instantly share code, notes, and snippets.

View cgrusden's full-sized avatar

Corey G cgrusden

  • Ruby on Rails, iOS, Consulting
  • 100% Remote
View GitHub Profile
@cgrusden
cgrusden / gist:d4b987dd3c8073a37810
Created March 17, 2016 16:53
How to control a team in Github
Thanks for writing in! I'd recommend that they add an owner of your organization as an admin collaborator on the repository in their own organization. Then that owner can fork the repository into your org, and add whatever team from your org that needs access to it. Then you should be able to open a pull request back to the parent repo owned by your customer when you're ready to submit change proposals.
module SlackMocks
class Client
end
class User
def initialize(user)
end
class Channel
end
@cgrusden
cgrusden / jeff_w.md
Created November 25, 2014 21:12
ferguson

On Ferguson: We all have biases. And the events of the last 24 hours have placed them on full display - in the news media, on the streets, and in social networks. It's interesting how very different people's definitions can be regarding basic principles like justice, morality, and the law. To some, the outcome means a criminal got what he had coming. To others, the grand jury's decision not to indict Officer Darren Wilson was another brick in the wall that keeps minorities from getting a fair shake. I think the truth lies somewhere in between. Last night I posted very briefly on the topic, implying that underneath all the fog, this specific situation is one where Michael Brown's choices led to a predictable outcome. This sparked a series of comments that surprised me with their emotion and racial overtones. I initially thought I would delete the post and comments, but I think I'll let them remain. The comments speak for themselves and I stand by mine. Some may have thought my post over-simplified the situatio

@cgrusden
cgrusden / bashrc.txt
Last active August 29, 2015 14:09
Commandline commands that are awesome
$ find $(rvm gemdir) -name *.css | xargs grep html
ls -l app/controllers/*.rb | awk '{printf "Fix/Review %s\r\n", $9}'
@cgrusden
cgrusden / parse_log_for_images.rb
Last active August 29, 2015 14:09
Parse log file for all image assets requested from the server
# Replace <file> with logfile from your server
grep -Eo 'GET\spath\S\"\/assets\/((\S+)[A-Za-z0-9]\-?\.(jpg|svg|gif|jpeg|png))\"' <file> | sort | uniq
@cgrusden
cgrusden / parser.rb
Created November 13, 2014 23:32
Filter your Google Contacts QUICK
# Steps to clean up your google contacts:
# Read to know how to Export your contacts to Google CSV format: https://support.google.com/mail/answer/24911?hl=en
# Download those contacts to ~/contacts/google.csv
# Put this code into ~/contacts/parser.rb
# Change to that directory: $ cd ~/contacts/parser.rb
# Run the parser: $ ruby parser.rb
# Hit k <enter> to KEEP that contact in your new clean list
# Hit <enter> to PASS on keeping that contact in your new clean list
# Once all the way through, copy the header-line (the first line of google.csv) into your new clean_contacts.csv
# Go back to Google, import this into your contacts (it will not remove any of your contacts, it will create a new Contacts group
@cgrusden
cgrusden / trello.rb
Created October 30, 2014 05:50
Output trello json into Markdown format
require 'json'
json = JSON.parse(File.read("trello.json"))
json["lists"].each do |list|
puts "# #{list['name']}\n"
json["cards"].each do |card|
if card["idList"] == list["id"]
puts "## #{card['name']}\n"
json["checklists"].each do |chklist|
@cgrusden
cgrusden / calculate.js
Created October 28, 2014 14:46
5min. blah.
// http://www.zagat.com/best-restaurants/new-york
nums = $.map($('.scores > .score.cost'), function(val, i) { return($(val).text()); }); //Get all boxes w/scores
clean = $.map(nums, function(val, i) { return(/\w+/.exec(val)); }); //Get rid of $
var total=0; $.each(clean, function(val, i) { total += val }); console.log(total) //Calculate total
Total = $4,950
@cgrusden
cgrusden / creed.txt
Last active August 29, 2015 14:05
Hunter S. Thompson
“My main luxury in those years-a necessary luxury, in fact-was the ability to work in and out of my home-base fortress in Woody
Creek.It was a very important psychic anchor for me, a crucial grounding point where I always knew I had love, friends, & good
neighbors.It was like my personal Lighthouse that I could see from anywhere in the world-no matter where I was, or how weird &
crazy & dangerous it got, everything would be okay if I could just make it home.When I made that hairpin turn up the hill onto
Woody Creek Road, I knew I was safe.”
@cgrusden
cgrusden / ajaxUpload.js
Created August 1, 2014 01:38
Ajax File Upload
$('input#headshot').on('change', (event) ->
jQuery.active++
files = event.target.files
formData = new FormData()
for file in files
formData.append('images[]', file, file.name)
xhr = new XMLHttpRequest()
xhr.open('POST', $(this).closest('form').attr('action'), true)