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.exports = Prompt; | |
function Prompt(question, cb) { | |
if (!(this instanceof Prompt)) return new Prompt(question, cb); | |
if ((question && cb) !== undefined) prompt(question, cb); | |
var self = this; | |
var vars = {}; | |
var queue = []; | |
self.ask = function (question, into) { |
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
pkrumins@stackvm:~/projects/stackvm$ rm data/*db | |
pkrumins@stackvm:~/projects/stackvm$ node server.js | |
9 Oct 00:59:37 - socket.io ready - accepting connections | |
StackVM running at http://localhost:9000 | |
^C | |
pkrumins@stackvm:~/projects/stackvm$ node server.js | |
9 Oct 01:00:11 - socket.io ready - accepting connections | |
StackVM running at http://localhost:9000 | |
^C | |
pkrumins@stackvm:~/projects/stackvm$ node server.js |
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
pkrumins@stackvm:~/projects/node-lazy$ cat tests/filter.js | |
var Lazy = require('lazy'); | |
var EventEmitter = require('events').EventEmitter; | |
function range(i, j) { | |
var r = []; | |
for (;i<j;i++) r.push(i); | |
return r; | |
} |
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
import Prelude hiding (catch) | |
import System (getArgs) | |
import System.IO (hPutStrLn, hSetBuffering, BufferMode(NoBuffering), hClose, Handle) | |
import System.IO.Error (isEOFError, IOError(..)) | |
import Network (connectTo, PortID(..), withSocketsDo) | |
import Control.Concurrent (forkIO, threadDelay) | |
import Control.Exception | |
delay :: Int | |
delay = 60 |
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.js | |
var dnode = require('dnode'); | |
function Manager () { | |
var desktops = {}; | |
var self = this; | |
this.spawn = function (name) { |
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
var $ = require('jquery-browserify'); | |
$(window).ready(function () { | |
if (!window.navigator.userAgent.match(/chrome|chromium/i)) { | |
$('<div>') | |
.addClass('alert') | |
.append( | |
$('<img>').attr('src', '/img/chrome.png'), | |
$('<div>').text( | |
"You don't appear to be using chrome, " |
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
#include <windows.h> | |
#include <cstdio> | |
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) { | |
while (1) { | |
HWND dialog = FindWindow("MozillaDialogClass", "FireFox Update"); | |
if (dialog) { | |
printf("Found dialog: %x\n", dialog); | |
HWND dialogItem = NULL; | |
SendMessage(dialog, WM_CLOSE, 0, 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
{-# LANGUAGE ForeignFunctionInterface #-} | |
import System.Win32.Types | |
import Foreign | |
import Foreign.C | |
foreign import stdcall unsafe "windows.h GetUserNameW" | |
c_GetUserName :: LPTSTR -> LPDWORD -> IO Bool | |
getUserName :: IO String |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* This is a modified version of https://github.com/nylki/lindenmayer. | |
** The modifications make it work in Internet Explorer again. | |
** The modifications include: | |
** * Replacing `let` with `var`. | |
** * Replacing `{ x }` with `{ x : x }` in object context. | |
** * Replacing `class` with `function. | |
** * Replacing `{ arg1, arg2, }` with `opts` in function definition context. | |
** * Replacing `x of obj` with a `for (var i = 0; i < obj.length; i++)` | |
** * Replacing default arguments with `if (arg === undefined) { arg = defaultVal; }` | |
** * Replacing `array.push(...obj)` with `array.extend(obj)`. |
OlderNewer