Skip to content

Instantly share code, notes, and snippets.

View nickgartmann's full-sized avatar

Nick Gartmann nickgartmann

View GitHub Profile

Venue

[ ] Get Rachel contact info for R&R

  • Yes we are using the R&R tables, chairs, and linens
  • We don't know yet if R&R has a mic [ ] Ask if R&R has a mic

Catering

[ ] Send Rachel our menu from littlebushel

  • No handpassed

Keybase proof

I hereby claim:

  • I am nickgartmann on github.
  • I am nickgartmann (https://keybase.io/nickgartmann) on keybase.
  • I have a public key ASB__m20abNP1PouhaOMmKDIw6EuQfbZ02TSw5t4zMfdewo

To claim this, I am signing this object:

@nickgartmann
nickgartmann / realtime.js
Created March 5, 2014 17:31
A bookmarklet for setting the favicon of google analytics to the number of people currently on your site. (Will break not update if not navigated to the real time page - I suggest leaving it sit as a pinned tab)
javascript:var thing=function(){var e=parseInt(document.getElementById("ID-overviewCounterValue").innerText);[].slice.call(document.querySelectorAll("link[type='image/x-icon']")).forEach(function(e){e.parentNode.removeChild(e)});var t=document.createElement("canvas");t.width=16;t.height=16;var n=t.getContext("2d");var r=function(){n.font="bold 10px sans-serif";n.fillText(e,e>9?2:4,12);var r=document.createElement("link");r.type="image/x-icon";r.rel="shortcut icon";r.href=t.toDataURL("image/x-icon");document.getElementsByTagName("head")[0].appendChild(r)};r()};setInterval(thing,1e3)
@nickgartmann
nickgartmann / draw.js
Created January 27, 2016 16:02
Function which draws the image.
function draw(width, height) {
canvas = $element.find("canvas");
canvas.attr("width", width);
canvas.attr("height", height);
// Browser API which allows us to manipulate canvas pixels
context = canvas[0].getContext("2d");
image_data = context.createImageData(width, height);
data = image_data.data
@nickgartmann
nickgartmann / User.rb
Created December 10, 2013 17:36
Login that works with twitter and facebook Requires that users have facebook_id and twitter_id
class User < Sequel::Model
def facebook_access_token=(value)
return if value.nil?
facebook_user = User.get_facebook_user(value)
self.email = facebook_user["email"] if self.email.nil? && !facebook_user["email"].blank?
self.facebook_id = facebook_user["id"]
end
def self.get_facebook_user(access_token)
facebook_user_request = RestClient.get "https://graph.facebook.com/me", {:params=> {:access_token => access_token } }
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
source "/Users/nickgartmann/.rvm/scripts/rvm"
source "/Users/nickgartmann/.rvm/contrib/ps1_functions"
YELLOW="\[\033[3;33m\]"
PURPLE="\[\033[3;35m\]"
NO_COLOR="\[\033[0m\]"
RED="\[\033[3;31m\]"
lib/mix/fetch_videos.ex:5: warning: variable next_page_token is unused
Compiled lib/mix/fetch_videos.ex
Generated day9tv app
14:46:52.337 [debug] BEGIN [] OK query=76.7ms queue=5.7ms
14:46:52.358 [debug] INSERT INTO "videos" ("inserted_at", "updated_at", "description", "episode_id", "large_thumbnail_url", "medium_thumbnail_url", "published_at", "small_thumbnail_url", "title", "youtube_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [{{2015, 12, 21}, {20, 46, 52, 0}}, {{2015, 12, 21}, {20, 46, 52, 0}}, "By popular demand, and by demand of catbert, I'll be playing SOMA. Let's see how far I can make it through w/o running away weeping.\n\nMy Website: http://day9.tv/\nMe on Twitter: http://twitter.com/day9tv/\nFind me on Facebook: http://www.facebook.com/day9tv/\nFancy Day[9] Swag: http://day9.tv/store/", nil, "https://i.ytimg.com/vi/ziZDwMSHoSI/hqdefault.jpg", "https://i.ytimg.com/vi/ziZDwMSHoSI/mqdefault.jpg", {{2015, 12, 21}, {16, 16, 30, 0}}, "https://i.ytimg.com/vi/ziZDwMSHoSI/default
{Model, Attributes} = require('nylas-exports')
_ = require('remote').require('underscore')
request = require('remote').require('request')
Q = require('../vendor/q')
CLIENT_ID = "REDACTED"
CLIENT_SECRET = "REDACTED"
REDIRECT_URI = "http://localhost:9999"
class Credential extends Model
xy2rgb: function(x,y) {
var X = x/y;
var Y = 1;
var Z = ((1 - x - y)/y);
X = X / 100.0;
Y = Y / 100.0;
Z = Z / 100.0;
Phetsarath OT:style=Regular
Century Schoolbook L:style=Roman
TlwgMono:style=Oblique
Nimbus Roman No9 L:style=Regular Italic
TlwgMono:style=BoldOblique
Courier 10 Pitch:style=Bold
Garuda:style=Book
Garuda:style=Bold
Lohit Tamil:style=Regular
DejaVu Sans:style=Bold