This file contains 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
module Jekyll | |
class CategoryCloud < Liquid::Tag | |
def render(context) | |
html = "" | |
categories = context.registers[:site].categories.map{|key, value| | |
{ | |
"title" => key, | |
"posts" => value | |
} | |
} |
This file contains 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
// server side | |
var dnode = require('dnode'); | |
var server = dnode({ | |
zing: function (n, cb) { cb(n*100) } | |
}); | |
server.listen(5050); | |
This file contains 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
$(document).ready(function(){ | |
$(".click").toggle(function(){ | |
$("#box").css("-webkit-transform","scale(2.1) rotate(-90deg)"); | |
}, | |
function () { | |
$("#box").css("-webkit-transform","scale(1) rotate(0)"); | |
}) | |
}) |
This file contains 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
//Example 1: basic method | |
var Hash = require('hashish'); | |
Hash({ a : 1, b : 2, c : 3, d : 4 }) | |
.map(function (x) { return x * 10 }) | |
.filter(function (x) { return x < 30 }) | |
.forEach(function (x, key) { | |
console.log(key + ' => ' + x); | |
}) | |
; |
This file contains 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
#!/usr/bin/env node | |
var argv = require('optimist') | |
.usage('Usage: $0 --snsd [member] --tara [song]') | |
.demand(['snsd']) | |
//.default({ 'snsd': 'Yuri', 'tara': 'Roly Poly'}) | |
.alias('snsd', 'gg') | |
.describe({'snsd': 'Girls\'s Generation', 'tara': 'T-ARA'}) | |
.argv; | |
console.log(argv.snsd + ":" + argv.tara); |
This file contains 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
<!-- Please remember include 'include.js' --> | |
<script src="https://browserid.org/include.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#browserid').click(function(){ | |
navigator.id.get(gotAssertion); | |
return false; | |
}); | |
}); |
This file contains 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
#!/usr/bin/env node | |
const | |
express = require('express'), | |
sessions = require('client-sessions'), | |
path = require('path'), | |
postprocess = require('postprocess'), | |
https = require('https'), | |
url = require('url'); |
This file contains 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> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div id="container"> | |
<div id="logo">LOGO</div> | |
</div> | |
</body> |
This file contains 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
// Initializing variables | |
var reminder = "take an umbrella"; | |
var weatherCondition = "rainy"; | |
// End of variables initializing | |
console.log('Started script: Remind me to ' + reminder + ' every day the first time I unlock my phone, if it is going to be ' + weatherCondition); | |
// register callback to device unlocked event |
This file contains 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> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<a href=http://github.co |