Skip to content

Instantly share code, notes, and snippets.

Working from home

Asad Dhamani dhamaniasad

Working from home
View GitHub Profile
kirilkirkov / gist:b13baec4b5142a527399693f8829547d
Created Jun 21, 2016
Difference between png-Interlaced, jpg-progressive AND png-non-Interlaced, jpg-baseline
View gist:b13baec4b5142a527399693f8829547d
Interlaced image loads an early degraded version of the whole image as soon as possible and then progressively renders the image to clear state.
Non-interlaced image will load up in tiles showing clear image in each tile as it progresses to load in the image.
For .jpg the interlaced = progressive and not interlaced = baseline.
karpathy /
Created May 30, 2016
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
rauchg /
Last active Feb 19, 2021
srph / oauth.js
Created Feb 21, 2016
axios: interceptor which includes your oauth token in every request as an Authorization header
View oauth.js
import axios from 'axios';
// You can use any cookie library or whatever
// library to access your client storage.
import cookie from 'cookie-machine';
axios.interceptors.request.use(function(config) {
const token = cookie.get(__TOKEN_KEY__);
if ( token != null ) {
config.headers.Authorization = `Bearer ${token}`;
mdang /
Last active May 10, 2021
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet


Create a new application

Install the Rails gem if you haven't done so before

View add-multiple-column-in-sequelize-migration.js
module.exports = {
up: function (queryInterface, Sequelize) {
return [
queryInterface.addColumn('User', 'name', {
type: Sequelize.STRING
queryInterface.addColumn('User', 'nickname', {
type: Sequelize.STRING,
GilLevi /
Last active Nov 17, 2020
Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Convolutional neural networks for emotion classification from facial images as described in the following work:

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns, Proc. ACM International Conference on Multimodal Interaction (ICMI), Seattle, Nov. 2015

Project page:

If you find our models useful, please add suitable reference to our paper in your work.

rwarbelow / running_app_in_production_locally.markdown
Created Nov 11, 2015
How to Run a Rails App in Production Locally
View running_app_in_production_locally.markdown
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

marcellodesales /
Last active Feb 10, 2021
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
# Author: Marcello de Sales (
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (
### Installation:
# * Add the Policy EC2:DescribeTags to a User
View Meteor Alternatives Per

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.