Skip to content

Instantly share code, notes, and snippets.

@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@qnighy
qnighy / center-test-2012.txt
Created January 14, 2012 12:21
2012年センター試験 自己採点
2012年センター試験 本試験
倫理、政治・経済 84/100
国語 169/200
英語(筆記) 196/200
英語(リスニング) 46/50
物理Ⅰ 92/100
化学Ⅰ 96/100
数学ⅠA 92/100
@milkypostman
milkypostman / pastels-on-dark-theme.el
Created March 4, 2012 18:20 — forked from shanecelis/pastels-on-dark-theme.el
Pastels on Dark theme for Emacs 24
;;; pastels-on-dark-theme.el --- Pastels on Dark theme for Emacs 24
;; Author: Mats Persson
;; Maintainer: Shane Celis <shane (at) gnufoo (dot) org>
;; URL: http://gist.github.com/1906662
;; Version: 0.3
;; Keywords: theme, color
;;; Commentary:
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@vbugarsk
vbugarsk / FacebookConnect.php
Created May 8, 2012 04:20
Facebook connect by CApplicationComponent
<?php
/**
* FacebookConnect class file.
* @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
/**
* Facebook connection application component.
@addyosmani
addyosmani / index.html
Created August 16, 2012 12:44
This was inspired by the Dribbble shot to the left of the canvas by Ramiro Galan, which can be found here: http://dribbble.com/shots/674715-Sparkle-Light-Trail. Some browsers still won't fully clear a canvas all the way with the destination-out globalCom
<!-- source image and inspiration from Ramiro Galan on Dribbble: http://dribbble.com/shots/674715-Sparkle-Light-Trail -->
<img src="http://dribbble.s3.amazonaws.com/users/36991/screenshots/674715/game.png" />
@burin
burin / gist:3840737
Created October 5, 2012 16:06
Full screen web app in iPhone 5 (save to home screen)
<!-- standard viewport tag to set the viewport to the device's width
, Android 2.3 devices need this so 100% width works properly and
doesn't allow children to blow up the viewport width-->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<!-- width=device-width causes the iPhone 5 to letterbox the app, so
we want to exclude it for iPhone 5 to allow full screen apps -->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
<!-- provide the splash screens for iPhone 5 and previous -->
<link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)">
<link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)">
@tj
tj / wtf.js
Created November 6, 2012 06:33
(function( app ) {
'use strict';
var ApplicationView = Ember.ContainerView.extend({
childViews: [ 'headerView', 'mainView', 'footerView' ],
headerView: Ember.ContainerView.create({
childViews: [ 'titleView', 'createTodoView' ],
elementId: 'header',
tagName: 'header',
titleView: Ember.View.create({
@mollifier
mollifier / zshrc_useful.sh
Last active July 8, 2024 09:22
少し凝った zshrc
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする