Skip to content

Instantly share code, notes, and snippets.

Christian Genco christiangenco

Block or report user

Report or block christiangenco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christiangenco
christiangenco / smu_swipes.rb
Created Mar 27, 2014
Download the swipes and flex dollars left on your SMU ID card.
View smu_swipes.rb
#!/usr/bin/env ruby
# Author: Christian Genco (@cgenco)
# 2013-09-04
SMU_ID = "SMU STUDENT ID GOES HERE"
SMU_PW = "SMU PASSWORD GOES HERE"
require 'time'
@logfilename = "/Users/cgenco/Dropbox/flex.log"
@christiangenco
christiangenco / keybase.md
Created Apr 9, 2014
Github ownership proof for keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am christiangenco on github.
  • I am cgenco (https://keybase.io/cgenco) on keybase.
  • I have a public key whose fingerprint is D1FA 6659 4379 E5B3 3867 9FF4 FF22 DC2D 357E 4A3C

To claim this, I am signing this object:

@christiangenco
christiangenco / MouseDetector.coffee
Created Sep 4, 2014
Detect if a browser has a mouse or not
View MouseDetector.coffee
class MouseDetector
constructor: () ->
@events = {
hasMouse: []
noMouse: []
}
mousemoves = 0
mouseFirstMoved = null
@christiangenco
christiangenco / dbinbox.en.yml
Created Sep 5, 2014
dbinbox.com language files 2014-09-05
View dbinbox.en.yml
en:
edit: edit
delete: delete
embed_code: embed code
authenticate: authenticate
@christiangenco
christiangenco / hn_impersonator.rb
Created Oct 7, 2014
Impersonate your favorite HN commenter
View hn_impersonator.rb
require 'http'
require 'json'
require 'peach'
require 'gabbler'
require 'pry'
USERNAME = "patio11"
unless File.exists?("comments.txt")
def get_json(url)
View WalkieSockie.ino
// WalkieSockie
// Christian Genco: @cgenco
// An alternate input/output device for the feet
// pins
static int pressurePin = A5, vibratorPin = 11;
// thresholds
static int pressureLow = 0, pressureHigh = 1000,
vibeLow = 0, vibeHigh = 255;
@christiangenco
christiangenco / istation_password_changer.js
Created Nov 3, 2014
Changes the password for all of your students to the 4 numbers in their student ID
View istation_password_changer.js
// log in to https://istation.com, navigate to your classroom (https://secure.istation.com/Classroom/Index/CLASSROOM_ID),
// then cut and paste the following into your URL bar and hit enter.
javascript:function changePassword(a){var b=document.createElement("IFRAME");b.setAttribute("src",a),b.style.width="100%",b.style.height="100%",b.style.position="fixed",b.style.top=0,b.onload=function(){console.log("loaded");var a=$(this);if(a.contents().find("h3.lead").length)a.remove(),urls.length>0&&changePassword(urls.pop());else{var b=a.contents().find("#Username").val(),c=b.match(/\d+/)[0];a.contents().find("#Password").val(c),a.contents().find("form[action*='/Student/Edit/']").submit()}},document.body.appendChild(b)}window.urls=$(".entity-list .ctxt-menu-target a").map(function(a,b){return"https://secure.istation.com"+$(b).attr("href").replace("Index","Edit")}).toArray(),changePassword(urls.pop());
@christiangenco
christiangenco / kid_blog_posts.tampermonkey.js
Created Nov 2, 2014
Adds a table showing how many comments each kid has added to each post.
View kid_blog_posts.tampermonkey.js
// ==UserScript==
// @name Add Post Table to Kid Blog
// @namespace http://christian.gen.co/
// @version 0.1
// @description Adds a table showing how many comments each kid has added to each post.
// @author Christian Genco
// @match http://kidblog.org/*/wp-admin/users.php
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
View I before E, except after C.md

Like in belIEve, fIErce, collIE, dIE, or frIEnd.

But flip "ie" if it's after C, like in deCEIve, CEIling, reCEIpt, or CEIlidh.

There are a few exceptions to this rule, though, like in speCIEs, sCIEnce, suffiCIEnt, or sEIze, wEIrd, vEIn, thEIr, forEIgn, or fEIsty.

In fact, in the default dictionary for Mac OS X 10.10, there are 2717 exceptions to this rule, and only 3901 words that follow it (full list below).

In other words: if you're trying to decide if a word should be spelled with "ie" or "ei," following this rule will only help you guess correctly 6 times out of 10.

View awk in 30 seconds.sh
# If you, like me, have always known about this `awk` thing
# when stealing one liners from Stack Overflow but always put
# off actually learning it, here's your 10 second lesson:
# Print lines in FILENAME that match pattern (the $0 is a
# variable that refers to the entire line, and can be omitted
# by default):
$ awk '/pattern/{print $0}' FILENAME
# ex: find all words that start with a capital A in the dictionary:
You can’t perform that action at this time.