Skip to content

Instantly share code, notes, and snippets.

View famanson's full-sized avatar

Son Pham famanson

View GitHub Profile
@famanson
famanson / instructions.md
Last active November 17, 2017 12:50
"WTF is... Machine Learning" coding session setup

"WTF is... Machine Learning" coding session setup

  1. Download Anaconda distribution Python version 3.6 from here.

  2. Follow the installation instructions for your system here.

  3. Download the necessary files using this link

  4. Move the zip file to your Documents folder and unzip it.

@famanson
famanson / pre-commit
Created January 19, 2017 14:44 — forked from DerLobi/pre-commit
Don't commit focused tests. Use this as a pre-commit hook and the commit won't succeed if you have staged changes that contain `fdescribe`, `fcontext`, `fit`, `fspecify` or `fexample`. Copy this file as `pre-commit` into the `.git/hooks` folder of your repository (create it if neccessary) and chmod +x the file.
#!/bin/sh
#
# This pre-commit hook looks for `fdescribe`, `fcontext`, `fit`, `fspecify` and `fexample` in the
# staged files and exits with an error code of 1 if there are such changes.
#
STATUS=0
DESCRIBEFILES=$(git diff --staged -G"^\s*fdescribe\(" --name-only | wc -l)
if [ $DESCRIBEFILES -gt 0 ]
save: function() {
// Update the item
var dateString = this.get('dateString'),
hour = this.get('hour'),
minute = this.get('minute'),
period = this.get('period'),
timezone = this.get('timezone'),
item = this.get('item');
// Let's convert the hour back to 24-hour format...
if (period === 'am' && hour === 12) {
@famanson
famanson / npm-list.out
Created August 7, 2015 17:57
NPM output from Son
$ npm list
esplorio-frontend@0.0.0 /Users/son/git/esplorio/frontend
├─┬ broccoli-asset-rev@2.1.0
│ ├── broccoli-asset-rewrite@1.0.8
│ ├─┬ broccoli-filter@0.1.14
│ │ ├─┬ broccoli-kitchen-sink-helpers@0.2.7
│ │ │ └─┬ glob@5.0.14
│ │ │ ├─┬ inflight@1.0.4
│ │ │ │ └── wrappy@1.0.1
│ │ │ ├── inherits@2.0.1

We have a data sync controller:

  • Let the user store data about their travel locally (generated by another part of the app)
  • Let the user upload the local data to our backend endpoint
  • Let the user pull extra travel data from our webservice when they are online
  • The extra data from the webservice would eventually be merged with the local data and the user can view both at the same time

Our questions are:

  • How would you implement the sync controller with those data flows?
@famanson
famanson / 900.out
Created July 21, 2015 04:51
SSH-enabled build failures
ubuntu@box637:~/esplorio-frontend$ npm test
> esplorio-frontend@0.0.0 test /home/ubuntu/esplorio-frontend
> ember test
version: 0.2.7
A new version of ember-cli is available (1.13.1). To install it, type ember update.
Could not find watchman, falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/#watchman for more info.
@famanson
famanson / ember-stuff.md
Last active August 29, 2015 14:25
EmberJS resources (Hanoi Javascript meetup)

EmberJS resources:

  • Main EmberJS website
  • ember-cli - command-line tools for project setup and deployment
  • ember-cli-deploy - lightning-fast deployment of Ember to redis/S3 included in eember-cli. You can find an example of a Redis-backed Flask-based Ember frontend endpoint I wrote here. An example deploy.js file that Esplorio uses can be found here
  • For those interested in Google Map integration, you can check this out (only compatible with Ember 1.13 for now - we skipped the latest version since 2.0 is coming up real soon)
  • For those interested in Ember server-side rendering, you can check out fastboot
  • A list of websites built with Ember can be found here
  • Esplorio
@famanson
famanson / gist:a961a98cada1dcc19c9f
Created June 30, 2015 17:35
esplor.io deployment checklist
`esplor.io` frontend deployment steps:
- Point `esplor.io` to `frontend`
- Update nginx on `frontend` to identify itself as `esplor.io`
- Make sure that `esplor.io` is now in the CORS whitelist of `staging`
`esplor.io` deployment backout steps:
- Point `esplor.io` back at `web1`
- Update nginx on `frontend` to identify itself as `frontend.esplor.io`
Environment:
Request Method: GET
Request URL: http://localhost:8000/auth/login/flickr
Django Version: 1.6.8
Python Version: 2.7.6
Installed Applications:
('opbeat.contrib.django',