Skip to content

Instantly share code, notes, and snippets.

@d2207197
d2207197 / bopomofo.schema.yaml
Last active August 29, 2015 14:03
squirrel 設定檔 ,改用 dvorak
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo
name: 注音
version: "1.6"
author:
- 佛振 <chen.sst@gmail.com>
description: |
@orzFly
orzFly / config.coffee
Last active August 29, 2015 14:23
node-config-loader
_ = require 'lodash'
fs = require 'fs'
class Config # Singleton
constructor: (env) ->
env || = process.env.NODE_ENV
env || = 'development'
@current = @load(env)
@env = env
@sorrycc
sorrycc / CSS Overflow Test Script
Created February 27, 2011 08:10
CSS Overflow Test Script
/**
* CSS Overflow Test Script
* @author sorrycc@gmail.com, @chenchengpro
* @doc http://www.chencheng.org/
*/
(function() {
// Text
@sofish
sofish / Native_FullScreen.js
Created November 10, 2011 09:02
Native FullScreen JavaScript API
/*
Native FullScreen JavaScript API
CopyRight: Johndyer, http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
-------------
Assumes Mozilla naming conventions instead of W3C for now
*/
(function() {
var
fullScreenApi = {
supportsFullScreen: false,
@williscool
williscool / post-commit
Created January 26, 2013 20:43
Git lab references post commit hook
#!/bin/sh
PRIVATE_TOKEN="YOU_SECRET_TOKEN"
GITLAB_URL="http://gitlab.example.com/"
URL=`git config --get remote.origin.url`
PROJECT=`basename ${URL} .git | cut -d':' -f2`
COMMIT_MSG="git log -1 HEAD"
COMMIT_HASH_MSG=`git log -1 HEAD | head -1`
@elado
elado / AngularBaseCtrl.coffee
Last active January 28, 2017 08:43
Angular.js CoffeeScript Controller Base Class
# dependency - Function.prototype.bind or underscore/lodash
app = angular.module 'someApp'
class @BaseCtrl
@register: (app, name) ->
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1]
app.controller name, @
@inject: (args...) ->
@sjoerdvisscher
sjoerdvisscher / curry.html
Created July 9, 2012 20:37
Curry and uncurry in JavaScript
<script>
function curry(f)
{
if (typeof f != "function" || f.length < 2)
return f;
return mkHelper(f, []);
}
function mkHelper(f, args)
@balupton
balupton / README.md
Last active September 29, 2018 18:31
Responsive layouts in stylus

Responsive layouts in stylus

Why this way?

  1. There is no span1..15 styles, instead your css defines your layout and your html remains semantic and not polluted with display information. As it should be.

  2. The markup is incredibly easy, you specify the wrappers width, and then each columns width in percentages. Every other grid framework I've found is incredibly complicated with this.

  3. It allows you to have the exact same markup, and completely different styles for different devices, resolutions, stylesheets, whatever. As it should be.

@redraiment
redraiment / Y Combinator 简介
Last active December 23, 2020 07:44
Y Combinator (Fixed-point Combinator) 不动点组合子
Y组合子是Lambda演算的一部分,也是函数式编程的理论基础。
它是一种方法/技巧,在没有赋值语句的前提下定义递归的匿名函数。
即仅仅通过Lambda表达式这个最基本的“原子”实现循环/迭代。
颇有道生一、一生二、二生三、三生万物的感觉。
虽然Y组合子在理论上很优美,但在实际开发中并不会真的用到。
想要了解Y组合子是什么,请参见维基百科:http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator
或者知乎上的回答:http://www.zhihu.com/question/20115649
@jonathantneal
jonathantneal / Demo
Created April 18, 2012 17:13
addEventListener for IE8
http://jsfiddle.net/GuQaV/show/