Skip to content

Instantly share code, notes, and snippets.

View cerdman's full-sized avatar

colin b. erdman cerdman

  • TriNetX Inc.
  • United States
View GitHub Profile
@addyosmani
addyosmani / headless.md
Last active November 21, 2025 21:40
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@Unitecho
Unitecho / gist:5524604
Created May 6, 2013 11:27
Angular Notes

Angular Notes

module

  • requires
  • name
  • provider
  • factory
  • service
  • value
import datetime
import os
import boto
from boto.emr.instance_group import InstanceGroup
from boto.emr.step import InstallPigStep, PigStep
conn = boto.connect_emr()
## Angular modules
http://ngmodules.org/
http://angular-ui.github.com/
http://angular-ui.github.com/bootstrap/
## Angular resources
John Lindquist Videos:
http://egghead.io
@tiffani
tiffani / gist:6471752
Created September 7, 2013 00:38
How to get Sqoop to share.
/root/installs/sqoop-1.4.2/build/sqoop-1.4.2.bin__hadoop-1.0.0/bin/sqoop export --connect jdbc:postgresql:where_its_at/muppets --table fulla_stuff --export-dir /more/stuff/part-r-00000
@aslamdoctor
aslamdoctor / useful-htaccess-code
Created September 19, 2013 07:44
Set of some useful Htaccess file code
301 Redirects
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
-------------------------------------------------------------
Custom Error Pages
ErrorDocument 400 /400.html
@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active December 11, 2019 22:38
Quicker Travis builds that rely on numpy and scipy using Miniconda

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

import boto, datetime, time
# Enter your AWS credentials
aws_key = "YOUR_AWS_KEY"
aws_secret = "YOUR_AWS_SECRET"
# Details of instance & time range you want to find spot prices for
instanceType = 'm1.xlarge'
startTime = '2012-07-01T21:14:45.000Z'
endTime = '2012-07-30T23:14:45.000Z'
# Protodash
class Instance(Resource):
resource_type = "instance"
metric_resource_type = resource_type
api_key = "instances"
id_key = "instance_id"
metric_id_key = "instance" #our resource ids are chaos
metric_column = "InstanceMetric"
@wilsonwc
wilsonwc / stateMock.js
Created January 10, 2014 17:24
Angular Mock for properly resolving ui-router $state in Karma unit tests
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
}else{