Readline is a more robust REPL.
readline = require('readline')
repl = readline.createInterface(stdin, stdout, autocomplete)
repl.historyIndex = 0
repl.history = ['App.Post.all()']
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
// Target API: | |
// | |
// var s = require('net').createStream(25, 'smtp.example.com'); | |
// s.on('connect', function() { | |
// require('starttls')(s, options, function() { | |
// if (!s.authorized) { | |
// s.destroy(); | |
// return; | |
// } | |
// |
// Place user-specific overrides in this file, to ensure they're preserved | |
// when upgrading | |
{ | |
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"] | |
} |
<html> | |
<body> | |
<video id="v" width="300" height="300"></video> | |
<input id="b" type="button" disabled="true" value="Take Picture"></input> | |
<canvas id="c" style="display:none;" width="300" height="300"></canvas> | |
</body> | |
<script> | |
navigator.getUserMedia({video: true}, function(stream) { | |
var video = document.getElementById("v"); | |
var canvas = document.getElementById("c"); |
local$ socat TCP-LISTEN:2222,bind=127.0.0.1,reuseaddr,fork TCP-LISTEN:2223,reuseaddr | |
local$ ssh -p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no localhost | |
remote$ socat TCP:10.0.2.2:2223 TCP:127.0.0.1:22 |
#!/bin/sh | |
# | |
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service | |
# | |
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net> | |
# | |
# Prerequisites: | |
# — MSYS2 itself: http://sourceforge.net/projects/msys2/ | |
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights | |
# |
~r~ = Red | |
~b~ = Blue | |
~g~ = Green | |
~y~ = Yellow | |
~p~ = Purple | |
~o~ = Orange | |
~c~ = Grey? | |
~m~ = Darker Grey | |
~u~ = Black | |
~n~ = New Line |
struct membuf : std::streambuf | |
{ | |
membuf(char *begin, char *end) : begin(begin), end(end) | |
{ | |
this->setg(begin, begin, end); | |
} | |
virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in) override | |
{ | |
if(dir == std::ios_base::cur) |
This is an example of using module tls
in NodeJS to create a client securely connecting to a TLS server.
It is a modified version from documentation about TLS, in which: