Skip to content

Instantly share code, notes, and snippets.

View idettman's full-sized avatar

Isaac A. Dettman idettman

View GitHub Profile
@idettman
idettman / simple.js
Created February 3, 2017 16:18 — forked from philogb/simple.js
window.addEventListener('DOMContentLoaded', function() {
//check support
if (!supportsWebGL()) {
$('webgl-canvas').innerHTML = 'Your browser doesn\'t seem to support WebGL. More info <a href=\'http://get.webgl.org/\'>here</a>.';
return;
}
//get context
var canvas = $('webgl-canvas'),
gl = getWebGLContext(canvas);
@idettman
idettman / namedCurry.js
Created February 19, 2017 02:15 — forked from CrossEye/namedCurry.js
Named Curry
var R = require('./ramda');
// Discussion at https://github.com/ramda/ramda/issues/1258
var namedCurry = function(fn, argNames) {
// TODO: what if fn.length != argNames.length?
var f = R.curryN(fn.length, function() {
return fn.apply(this, arguments);
});
f['secret-sauce'] = {
@idettman
idettman / FlickrFunctionalSuite-NEW-2014-Tilford.user.js
Created February 19, 2017 21:24 — forked from decembre/Flickr Functional Suite Update and Note.md
Flickr Functional Suite - NEW 2014 is a new working version provided by Ch. Tilford himeself (great thanks to him !) for firefox greater than 21.
// ==UserScript==
// @name Flickr Functional Suite - NEW
// @namespace http://www.tilford.net/
// @description Adds some additional functionality to page
// @include http://*.flickr.com/*
// @include http://flickr.com/*
// @include https://*.flickr.com/*
// @include https://flickr.com/*
// @grant GM_getValue
// @grant GM_setValue
// ==UserScript==
// @name Flickr Quick Comment (OK - Vispillo + NEW inculde https)
// @description Adds a select box with pre written comments. Derived from Steeev Group Promotion Tool
// @author Pierre Andrews. (code base Steeev http://steeev.f2o.org/, pt translation by Perla* <http://www.flickr.com/photos/bobnperla/>)
// @namespace http://6v8.gamboni.org/
// @include http://*flickr.com/photos/*
// @include https://*flickr.com/photos/*
// @include http://*flickr.com/groups/*/discuss*
@idettman
idettman / 01-functional-ui.js
Created February 21, 2017 23:50 — forked from mikaelbr/01-functional-ui.js
Example of functional UI and higher order components for React/Omniscient.js (http://omniscientjs.github.io/)
import React from 'react';
import component from 'omniscient';
import immstruct from 'immstruct';
import { compose, valueNode, partialProps } from './compose';
const data = immstruct({ counter: 0, title: 'My title' });
const em = component(({partialedTitle, children}) =>
<em>{partialedTitle}: {children}</em>);
@idettman
idettman / bst.js
Created March 12, 2017 18:18 — forked from agborkowski/bst.js
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*
export const loop_raycaster = (APP) => {
const cameraNative = APP.camera.getNative();
const raycaster = APP.raycaster;
const ray = APP.raycaster.ray;
const plane = APP.planeForRaycasting;
return new WHS.Loop(() => {
raycaster.setFromCamera(
new THREE.Vector2(
(APP.cursor.x / window.innerWidth) * 2 - 1,
@idettman
idettman / flashflush.sh
Created July 22, 2017 23:37 — forked from 50kudos/flashflush.sh
A Bash script that lists all unused css classes in html/haml/erb files for rails project (or maybe others depending on project structure)
#!/bin/bash
cat $(find app/assets/stylesheets/ -type f) |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// |
while read CSS; do
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then
echo $CSS >> unused.scss;
fi
done
@idettman
idettman / README.md
Created September 26, 2017 15:41 — forked from ngryman/README.md
intellij javascript live templates

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
import time
from browsermobproxy import Server
server = Server('/Users/dhunt/Downloads/browsermob-proxy-2.0-beta-6/bin/browsermob-proxy')
server.start()
proxy = server.create_proxy()
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)