Skip to content

Instantly share code, notes, and snippets.

View founddrama's full-sized avatar
🗺️
time zone chauvinist

Rob Friesel founddrama

🗺️
time zone chauvinist
View GitHub Profile
@founddrama
founddrama / Things-Logbook-Purge.js
Last active September 2, 2016 14:47
prototype script to purge my Things Logbook of "known junk"
disposableTodoNames = [
"Clean out dishwasher filter",
"Clean out toaster crumb tray",
"Clean refrigerator",
"🐱Clean Cat Box"
];
function isTrashable(todo) {
return disposableTodoNames.indexOf(todo.name()) > -1 ||
(todo.area().name().indexOf('Shopping') > -1);
@founddrama
founddrama / .htaccess
Created February 2, 2016 01:39
.htaccess snippet for blog post
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
@founddrama
founddrama / get-menu.rb
Created January 18, 2016 01:56
Screenscraper in miniature to look up the menu on the school website and mail it to me.
require 'net/http'
require 'nokogiri'
require 'net/smtp'
require 'securerandom'
page = Nokogiri::HTML(Net::HTTP.get(:DOMAIN_REDACTED, '/food-service/'))
days = page.css('.lunch-calendar thead th').collect { |td| td.text }
menu = page.css('.lunch-calendar tbody tr:first-of-type td a').collect { |td| td.text }
@founddrama
founddrama / screenshot-beer-styles.js
Created October 26, 2015 16:22
Because it was pretty and I wanted a copy of it. ¯\_(ツ)_/¯
var casper = require('casper').create();
casper.options.viewportSize = { width: 1280, height: 1024 };
casper
.start('http://www.craftbeer.com/beer-styles', function() {
this.evaluate(function() {
$('#social-links').remove();
});
@founddrama
founddrama / potter.js
Created June 13, 2015 18:50
Harry Potter titles re-imagined if he was a JavaScript developer.
[ "Sorcerer's Semicolon",
"Chamber of Closures",
"Transpiler of Azkaban",
"Goblet of Cruft",
"Order of the Variables",
"Half-Right Kludge",
"Deathly For-Loop"
].map(i => `Harry Potter and the ${i}`);
@founddrama
founddrama / alt-vars.scss
Last active August 29, 2015 14:10
Simplest-possible SCSS theming approach
// in themes/
$background_color: #E22;
$foreground_color: #ded;
$text_color: #030;
@founddrama
founddrama / gist:17f27a7630a5683f7bdb
Last active August 29, 2015 14:05
Oh nothing just screenscraping Untappd for my beer data because they're so stingy with their API keys.
var casper = require('casper').create(),
username = casper.cli.args[0],
passwod = casper.cli.args[1],
UNTAPPD = 'https://untappd.com';
// in which we get all the beers
// in which we assume `$` == `jQuery` already on this page
function collectBeers(UNTAPPD) {
var beers = [],
items = $('.beer-item'),
"use strict";
function freeze(o) {
if(!Object.isFrozen(o)) {
Object.freeze(o);
}
return o;
}
@founddrama
founddrama / gist:6567007
Last active December 23, 2015 02:29
GDI class #1 meditation blog post thingy
var favoriteThings = ['coffee', 'kittens', 'bacon sandwiches'];
var out;
for (var i = 0; i < favoriteThings.length; i++) {
out += favoriteThings[i] + ', ';
}
console.log('My favorite things are: ' + out);
// Paul Irish talking about Chrome DevTools Timeline's new Frame Mode
http://www.youtube.com/watch?v=Vp524yo0p44
// Chrome Office Hours - troubleshooting paint times
http://www.youtube.com/watch?v=z0_jD8nO5Zw
// Break time to glass - youtube
http://youtu.be/Il4swGfTOSM
// Avoiding Unnecessary Paints