Skip to content

Instantly share code, notes, and snippets.

View calvin's full-sized avatar

Calvin Jeong calvin

View GitHub Profile
@calvin
calvin / README.md
Created January 5, 2018 07:46 — forked from kmpm/README.md
smstools with usb dongle on rpi

How to install smstools on Raspberry PI with a nn dongle

Get deviceid for the dongle

sudo lsusb

I get the result...

@calvin
calvin / index.d.ts
Created June 2, 2017 04:33
Typescript definition for `virtualize` function in `react-swipeable-views-utils`
declare module "react-swipeable-views-utils" {
import ReactSwipeableViews from "react-swipeable-views";
export interface VirtualizedSlideRendererParams {
index: number;
key: number;
}
interface VirtualizedComponentProps {
index?: number;
@calvin
calvin / three-colladaloader.d.ts
Created April 20, 2017 06:46
Typescript definition for THREE.ColladaLoader
/// <reference types="three" />
declare namespace THREE {
interface ColladaOptions {
centerGeometry: THREE.Geometry | false;
convertUpAxis: boolean;
subdivideFaces: boolean;
upAxis: "X" | "Y" | "Z";
defaultEnvMap: THREE.Mapping;
}
@calvin
calvin / Path3.js
Last active March 1, 2017 22:35
Path3 implementation of three.js (r84)
Path3.prototype = Object.create( THREE.Curve.prototype );
Path3.prototype.constructor = Path3;
Path3.prototype.getPoint = function ( t ) {
var points = this.points;
var l = points.length;
if ( l < 2 ) console.log( 'duh, you need at least 2 points' );
var point = ( l - 1 ) * t;
@calvin
calvin / multiform.py
Last active September 18, 2016 03:15 — forked from jamesbrobb/multiform.py
django multiform mixin and view that allows the submission of a) All forms b) Grouped forms c) An individual form
from django.http.response import HttpResponseForbidden, HttpResponseRedirect
from django.views.generic.base import ContextMixin, TemplateResponseMixin
from django.views.generic.edit import ProcessFormView
class MultiFormMixin(ContextMixin):
form_classes = {}
prefixes = {}
success_urls = {}
/*
* transports.js: Set of all transports Winston knows about
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*
*/
var path = require('path');
@calvin
calvin / index.d.ts
Last active March 12, 2019 12:05
node-firebird typescript definition
interface FirebirdConnectionOptions {
host?: string;
port?: number;
database?: string;
user?: string;
password?: string;
role?: any;
pageSize?: number;
}
@calvin
calvin / keybase.md
Last active July 20, 2016 00:24
Keybase proof

Keybase proof

I hereby claim:

  • I am calvin on github.
  • I am seyeongjeong (https://keybase.io/seyeongjeong) on keybase.
  • I have a public key whose fingerprint is F576 C8FB 778C F570 0355 BE2A 0115 1196 FDFB 34FB

To claim this, I am signing this object:

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.topojson={})}(this,function(n){"use strict";function t(){}function r(n){if(!n)return t;var r,e,o=n.scale[0],i=n.scale[1],u=n.translate[0],f=n.translate[1];return function(n,t){t||(r=e=0),n[0]=(r+=n[0])*o+u,n[1]=(e+=n[1])*i+f}}function e(n){if(!n)return t;var r,e,o=n.scale[0],i=n.scale[1],u=n.translate[0],f=n.translate[1];return function(n,t){t||(r=e=0);var c=(n[0]-u)/o|0,a=(n[1]-f)/i|0;n[0]=c-r,n[1]=a-e,r=c,e=a}}function o(n,t){for(var r,e=n.length,o=e-t;o<--e;)r=n[o],n[o++]=n[e],n[e]=r}function i(n,t){for(var r=0,e=n.length;e>r;){var o=r+e>>>1;n[o]<t?r=o+1:e=o}return r}function u(n,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return f(n,t)})}:f(n,t)}function f(n,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:c(n,t)};return null==t.id&&delete r.id,r}function c(n,t){function e(n,t){t.length
@calvin
calvin / qurl.py
Last active February 21, 2016 03:58 — forked from pricco/qurl.py
Django Template Tag: Url query string modifier
"""qurl is a tag to append, remove or replace query string parameters from an url (preserve order)"""
import re
from django.template import Library, Node, TemplateSyntaxError
from urlparse import urlparse, parse_qsl, urlunparse
from django.utils.encoding import smart_str
from urllib import urlencode
register = Library()