This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(comment | |
(:b (DefaultMap. :foo {:a 1})) | |
; => :foo | |
(:a (DefaultMap. :foo {:a 1})) | |
; => 1 | |
(merge-with conj (DefaultMap. [] {}) {:a 1} {:a 2} {:a 3}) | |
; => {:a [1 2 3]} | |
) | |
;;; method implementations basically taken from clojure.core/emit-defrecord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin rgba-background($color, $opacity) { | |
background-color: $color; | |
background-color: rgba($color, $opacity); | |
background-color: transparent\9; | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))},endColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))}); | |
zoom: 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
my_json = { :array => [1, 2, 3, { :sample => "hash"} ], :foo => "bar" } | |
puts JSON.pretty_generate(my_json) | |
Which gets you... | |
{ | |
"array": [ | |
1, | |
2, | |
3, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i | |
me | |
my | |
myself | |
we | |
our | |
ours | |
ourselves | |
you | |
your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import timeit | |
logger = logging.getLogger(__name__) | |
def log_noop(): | |
pass | |
def log_simple(): | |
logger.info("Testing") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logbook | |
import timeit | |
logger = logbook.Logger(__name__) | |
def log_noop(): | |
pass | |
def log_simple(): | |
logger.info("Testing") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>jQuery Validation Pluginの簡単なサンプル</title> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.min.js"></script> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> | |
<script>(function(){ | |
// 標準メッセージの上書き(日本語化等)とカスタム項目のメッセージを設定します。 | |
$.extend($.validator.messages, { | |
email: 'メールアドレスの形式で入力して下さい。(例: [email protected])', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ajax-send.js - copyright Jake Bellacera (http://jakebellacera.com) | |
This script uses JQuery & JQuery Validate (https://github.com/jzaefferer/jquery-validation) | |
For this example, we will have a form named '#ajaxform', you can of course change this to whatever you'd like. | |
*/ | |
$(function(){ | |
$('#submitbutton').click(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from the javascript implementation at http://sedition.com/perl/javascript-fy.html | |
# Randomizes the order of elements in the passed in array in place. | |
fisherYates = (arr) -> | |
i = arr.length; | |
if i == 0 then return false | |
while --i | |
j = Math.floor(Math.random() * (i+1)) | |
tempi = arr[i] |