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
var random = new Random(); | |
RandomStreamGenerator.GenerateIndefinitley(() => (Keys)(random.Next(1,150), k => /* do something with the key */); |
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
//app.js | |
var express = require('express') | |
, http = require('http') | |
, fs = require('fs'); | |
var app = express(); | |
app.configure(function(){ | |
app.set('port', process.env.PORT || 3000); |
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
####################################### | |
APM | |
####################################### | |
public partial class APMVersion : Form | |
{ | |
private const int BUFFER_SIZE = 1024; | |
public Form1() | |
{ |
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
var flash = require('express-flash')(); | |
module.exports = function() { | |
return function(req, res, next) { | |
flash(req, res, function() { | |
req.jsonFlash = function() { | |
if (arguments.length === 1) { | |
var data = req.flash(arguments[0]); | |
if (data.length) { | |
return JSON.parse(data); |
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 'erb' | |
require 'ostruct' | |
class << ERB | |
def compile(template, locals) | |
renderer = ERB.new(template) | |
struct = OpenStruct.new(locals) | |
class << struct | |
def get_binding | |
binding() |
OlderNewer