It uses markdown!
var so = { "this" : "is" }, a = "test";- One
| #!/usr/bin/node | |
| /* butterfly state machine */ | |
| var Egg = function(species) { | |
| this.species = species; | |
| console.log("An egg"); | |
| this.hatch = function() { |
| var Service = require('services'); | |
| var express = require('express'); | |
| var log = require('clog'); | |
| var mongodb = require('mongodb'); | |
| var amqp = require('amqp'); | |
| logService = function(settings, services, cb) { | |
| if(settings.debug) { | |
| log.configure({'log level' : 5}); |
| <div class='row-fluid'> | |
| <div class='span6'> | |
| <div class='row-fluid'> | |
| <div> | |
| <form class="navbar-search pull-left"> | |
| <input type="text" class="search-query" placeholder="Search" style="background-color: white; border-color: #ccc;"> | |
| </form> | |
| </div> | |
| </div> |
| <!doctype html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script> | |
| <script> | |
| function CSS($scope) { | |
| $scope.css = "body {\n background-color: #000;\n}"; | |
| } | |
| angular.module('stylatron', []).directive('ngStyleContents', | |
| function() { |
| line = '\n'+80*'*'+'\n' #formatting helper | |
| # A quick overview of argument handling in python | |
| # ************************************************************************ | |
| # In python, functions have arguments which are both positional and keyword | |
| # arguments, that is you can call a function using implicit positions to assign | |
| # values to an argument, or you can call them with specific arguments. | |
| # Arguments can also have defaults in the function definition, as with the |
| // Mongo DB queue helper. | |
| var oneMinute = 60 * 1000; // in js milliseconds. | |
| var lockTime = 30 * oneMinute; | |
| var safeOpts = { safe: true, w: 1, journal: true }; | |
| /* processQueuedItems(collection, filter, taskFunc, log, callback) | |
| * | |
| * collection: a mongodb Collection object |
| import csv, StringIO, random, sys | |
| from datetime import date, timedelta as td | |
| try: | |
| count = int(sys.argv[1]) | |
| except: | |
| count = 10 | |
| def dates(d1, d2): | |
| return [str(d1 + td(days=x)) for x in range((d2-d1).days + 1)] |
| function groupData(data, nGroups) { | |
| var out = []; | |
| data.sort(function(a, b) { return a > b; }) | |
| var hop = data[data.length-1] / nGroups; | |
| for(var i=0; i<data.length; i++) { | |
| var index = Math.ceil(data[i] / hop); | |
| if(!out[index]) out[index] = []; | |
| out[index].push(data[i]); | |
| } |