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
| #!/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 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
| <!-- 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 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
| #!/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 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
| //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 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
| $(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 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
| // server side | |
| var dnode = require('dnode'); | |
| var server = dnode({ | |
| zing: function (n, cb) { cb(n*100) } | |
| }); | |
| server.listen(5050); |
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
| 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 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
| <?php | |
| use Monolog\Logger; | |
| use Monolog\Handler\StreamHandler; | |
| //create a log channel | |
| $log = new Logger('name'); | |
| $log->pushHandler(new StreamHandler('/path/to/log', Logger::WARNING)); | |
| // add records to the log |
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
| <?php | |
| $username = ''; | |
| $password = ''; | |
| $blogid = ''; // Can get using wp.getUsersBlogs | |
| $target_host = ''; | |
| $xmlrpc_method = ''; | |
| function get_response($url, $context){ | |
| if(!function_exists('curl_init')){ |
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
| <!-- layout.html.twig --> | |
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <link rel="stylesheet" href="style.css" /> | |
| <title>Welcome to Twig</title> | |
| </head> | |
| <body> | |
| <div id="content">{% block content %}{% endblock %}</div> | |
| </body> |