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 / safari.md
Created December 27, 2022 05:22 — forked from RobertAKARobin/safari.md
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. As such, most of our customers are in their 60s or older. We have found that many of them are using iPads or iPhones. And they're the ones complaining to our customer support line about our site being unusable.

The problem

This is what pops up when you tap on a date field. Not bad... unless you're trying to pick your birth date, which happened to be in 1945.

@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
@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:

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

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

@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');
@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 / 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);
# 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 = {
# 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