Skip to content

Instantly share code, notes, and snippets.

View calvin's full-sized avatar

Calvin Jeong calvin

View GitHub Profile
@calvin
calvin / sfWidgetFormSchemaFormatterBootstrap.class.php
Created October 20, 2012 05:20 — forked from malteo/sfWidgetFormSchemaFormatterBootstrap.class.php
Symfony form formatter to use with Twitter Bootstrap CSS
<?php
/**
* A FormSchemaFormatter to use with Twitter Bootstrap CSS.
*
* @author malteo
*/
class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter
{
protected
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns('Ext.ux.form');
/**
* @class Ext.ux.form.FileUploadField
<?php
class sfWidgetFormInputColor extends sfWidgetFormInput
{
protected function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
$this->setOption('type', 'color');
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd">
<channel>
<title>신해철의 고스트 스테이션</title>
<item>
<title>2012년 10월 22일 월요일 방송분</title>
<itunes:author>iMBC</itunes:author>
<description>신해철의 고스트 스테이션 2012년 10월 22일 월요일 방송분 입니다.</description>
<enclosure type="audio/mpeg" url="http://podcastfile.imbc.gscdn.com/mp3/radio/podcast/ghoststation/ghoststation_20121022.mp3"/>
<guid>http://podcastfile.imbc.gscdn.com/mp3/radio/podcast/ghoststation/ghoststation_20121022.mp3</guid>
@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()
!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 / 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:

@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;
}
/*
* transports.js: Set of all transports Winston knows about
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*
*/
var path = require('path');
@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 = {}