Skip to content

Instantly share code, notes, and snippets.

View chrishowes's full-sized avatar

Chris Howes chrishowes

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'VisitDays'
});
@chrishowes
chrishowes / controllers.application.js
Created August 26, 2016 21:35
Ember Dynamic Field Components
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model: {
'firstName': {
'value': 'Chris',
'component': 'text-input'
},
'age': {
import Ember from 'ember';
export default Ember.Component.extend({
count: 0,
lastSource: 'nowhere',
show: false,
actions: {
showModal() {
this.set('show', true);
},
@chrishowes
chrishowes / gist:70d35ea122ed921c7fc8
Created October 20, 2015 22:46
List of environment variables for MeteorJS
process.env.APP_ID
process.env.APP_MONGO
process.env.AUTOUPDATE_VERSION
process.env.BIND_IP
process.env.CONSTRAINT_SOLVER_BENCHMARK
process.env.DDP_DEFAULT_CONNECTION_URL
process.env.DEPLOY_DOMAIN
process.env.DEPLOY_HOSTNAME
process.env.DISABLE_WEBSOCKETS
process.env.DISCOVERY_PORT
@chrishowes
chrishowes / gist:10612759
Created April 14, 2014 02:59
AngularJS, Chrome Extensions, and CSP issues (ngClick, ngKeypress, etc.)
This bit of code doesn't work:
<div ng-controller="MainCtrl" ng-csp>
<input type="text" ng-click="clickFunction()">
</div>
function MainCtrl($scope) {
$scope.clickFunction = function(event) { console.log(event); }
}
@chrishowes
chrishowes / mysql_to_pandas_df.py
Created April 13, 2014 17:30
MySQL to Pandas DataFrame
import pandas as pd
import MySQLdb
db_conn = MySQLdb.connect(host="HOST", user="USER", passwd="PW", db="DATABASE")
sql_str = "SELECT field FROM table"
df = pdb.io.sql.read_frame(sql_str, db_conn)
@chrishowes
chrishowes / fb-add-sdk.coffee
Created April 24, 2013 23:47
FB code to add SDK converted to CoffeeScript
window.fbAsyncInit = ->
FB.init
appId: "YOUR_APP_ID" # App ID
channelUrl: "//WWW.YOUR_DOMAIN.COM/channel.html" # Channel File
status: true # check login status
cookie: true # enable cookies to allow the server to access the session
xfbml: true # parse XFBML
FB.Event.subscribe "auth.statusChange", handleStatusChange
@chrishowes
chrishowes / quickle.py
Created March 4, 2013 15:54
quickle - quick python unpickler. prints value to stdout. usage - python quickle.py file_to_unpickle.txt
import pickle
import sys
print pickle.load(open(sys.argv[1], 'r'))