Skip to content

Instantly share code, notes, and snippets.

View shanechin's full-sized avatar

Shane Chin shanechin

  • Columbia University
  • New York, New York
View GitHub Profile
@shanechin
shanechin / test.js
Created August 27, 2012 00:26 — forked from dbamber/test.js
Testing GOogle document api support for tables
/*
* Author: David Bamber <dbamber@gmail.com>
* http://bmbr.co
*
* Usage: node test.js -u <googleuser> -p <googlepass>
* node test.js -u <googleuser> -p <googlepass> -regex -url /feeds/default/private/full
*
* Optional Fags:
* -url [url]: requests a different uri from docs api, defaults to /feeds/default/private/full/-/table
* -regex: applies a regex to try and sanitize output
# source this code in a Bash shell ($ . django-csrftoken-login-demo.bash),
# and run with a DB name as parameter (e.g. $ django-csrftoken-login-demo demo)
django-csrftoken-login-demo() {
# -- CHANGE THESE VALUES TO MATCH YOUR ACCOUNT --
local HOSTING_USERID=9988
local HOSTING_PANEL_USER='customer@email.address'
local HOSTING_PANEL_PASS='my secret login password'
local HOSTING_DB_PREFIX='username_'
local DB_NAME=$HOSTING_DB_PREFIX$1
# After spending too much time away from Python on Javascript, I gave this a shot. To my surprise, it worked!
# Since Python doesn't bind "self" explicitly in classes, this looks almost exactly like Python classes.
# The only visible difference is that you cannot simply access the members using the dot syntax (cat.sayHi).
# It must be accessed as a dictionary.
def Cat(legs, colorId, name):
def sayHi():
print 'Hi, my name is %s. I have %s legs and am %s.' % (this['name'], this['legs'], this['color'])
this = {
@shanechin
shanechin / OAuth.cls
Last active August 29, 2015 14:17 — forked from surjikal/OAuth.cls
public class OAuth {
public static HttpRequest signRequest(HttpRequest req, String consumerKey, String consumerSecret) {
String nonce = String.valueOf(Crypto.getRandomLong());
String timestamp = String.valueOf(DateTime.now().getTime() / 1000);
Map<String,String> parameters = new Map<String,String>();
parameters.put('oauth_signature_method','HMAC-SHA1');
parameters.put('oauth_consumer_key', consumerKey);
parameters.put('oauth_timestamp', timestamp);
@shanechin
shanechin / trypy
Last active August 29, 2015 14:19 — forked from naftaliharris/trypy
#!/bin/bash
# An enhancement to the "python" executable that automatically launches you into the python debugger on error.
#
# Use it like you would the "python" executable, for example:
# $ trypy somefile.py
# or
# $ trypy somefile.py arg1 arg2
#
# EXAMPLE:
@shanechin
shanechin / gulpfile.js
Created November 7, 2015 12:24 — forked from soin08/gulpfile.js
Gulpfile.js to use with Django projects. Based on gulpfile.js from Google Web Starter Kit.
//Based on gulpfile.js from Google Web Starter Kit.
//https://github.com/google/web-starter-kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

How Dev Bootcamp Teaches: ActiveRecord

I'm Jesse, one of the co-founders of Dev Bootcamp, and the acting curricular editor-in-chief. We get lots of questions about how Dev Bootcamp approaches teaching, what our curriculum is like, and how it differs from other schools and competitors. I thought I'd share some of that with you, starting with a brief overview of our theory of learning and then sharing our introduction to ActiveRecord.

This will be light on theory and heavy on ActiveRecord, so if you're not familiar with SQL or Ruby it might be hard to follow. Mea culpa.

Dev Bootcamp's Theory of Learning

At Dev Bootcamp, we believe that "modeling" is central to learning. The most effective students have a clear model of how the world works and are able to quickly integrate new information int

@shanechin
shanechin / app.yaml
Created November 14, 2021 03:57 — forked from alukach/app.yaml
An example Github Actions for Python + Pipenv + Postgres + Pyright
# .github/workflows/app.yaml
name: My Python Project
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
@shanechin
shanechin / WebViewResizing.js
Created September 26, 2022 18:55 — forked from dbasedow/WebViewResizing.js
Resize WebView to content height in react-native
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {AppRegistry, Text, WebView, View, Dimensions} = ReactNative;
var WebViewResizing = React.createClass({
getInitialState: function () {
return {
webViewHeight: 100 // default height, can be anything