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
(* | |
ParserLibrary.fsx | |
Final version of a parser library. | |
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/ | |
*) | |
module TextInput = | |
open System |
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
(ns console-demo.template) | |
(def delimiters ["<%" "%>"]) | |
(def parser-regex | |
(re-pattern | |
(str "(?s)\\A" | |
"(?:" | |
"(.*?)" (first delimiters) "(.*?)" (last delimiters) | |
")?" |
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
defmodule Echo.Server do | |
def start(port) do | |
tcp_options = [:binary, {:packet, 0}, {:active, false}] | |
{:ok, socket} = :gen_tcp.listen(port, tcp_options) | |
listen(socket) | |
end | |
defp listen(socket) do | |
{:ok, conn} = :gen_tcp.accept(socket) | |
spawn(fn -> recv(conn) end) |
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
declare module 'js-csp' { | |
namespace Boxes { | |
class Box<T> { | |
value: T | |
constructor(value: T) | |
} | |
class PutBox<T> { | |
handler: Handlers.HandlerType | |
value: T |
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
// IMPORTANT: choose one | |
var RL_LIB = "libreadline"; // NOTE: libreadline is GPL | |
//var RL_LIB = "libedit"; | |
var HISTORY_FILE = require('path').join(process.env.HOME, '.mal-history'); | |
var ffi = require('ffi'), | |
fs = require('fs'); | |
var rllib = ffi.Library(RL_LIB, { |
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
through = require('through2') | |
gulp.task 'src', -> | |
gulp.src './src/*.coffee' | |
.pipe coffee({bare: true}) | |
.pipe gulp.dest('./dest/') | |
.pipe through.obj((file, encoding, callback) -> | |
callback(null, doSomethingWithTheFile(file)) | |
) | |
.on 'error', gutil.log |
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
# bash proxy | |
# export HTTP_PROXY=http://127.0.0.1:16823/ | |
# export http_proxy=http://127.0.0.1:16823/ | |
# export HTTPS_PROXY=https://127.0.0.1:16823/ | |
# export https_proxy=https://127.0.0.1:16823/ | |
# export ALL_PROXY=http://127.0.0.1:16823/ | |
# export all_proxy=https://127.0.0.1:16823/ | |
# go path | |
export GOROOT=/usr/local/opt/go/libexec |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.Threading; | |
namespace Sa1 { | |
/// <summary> | |
/// ins: do not use timeout in the csp.subthread |
NewerOlder