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
#!/bin/sh | |
# brew install h2o | |
# clone h2o | |
# cmake . | |
# make install | |
H2OCONF=`mktemp -t h2o.conf` | |
CRT=`mktemp -t server.crt` |
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
package net.lowreal; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; | |
import javax.script.ScriptException; | |
public class Main { | |
public static void main(String[] args) throws ScriptException { | |
final ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); |
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 DTMF = function () { this.init.apply(this, arguments) }; | |
DTMF.prototype = { | |
table : { | |
"1" : [697, 1209], "2" : [697, 1336], "3" : [697, 1477], "A" : [697, 1633], | |
"4" : [770, 1209], "5" : [770, 1336], "6" : [770, 1477], "B" : [770, 1633], | |
"7" : [852, 1209], "8" : [852, 1336], "9" : [852, 1477], "C" : [852, 1633], | |
"*" : [941, 1209], "0" : [941, 1336], "#" : [941, 1477], "D" : [941, 1633] | |
}, | |
init : function (context, opts) { |
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
#!/usr/bin/xcrun swift | |
import Cocoa | |
struct ProgramOption { | |
var list : Bool = false | |
var set : String? = nil | |
var help : Bool = false | |
} |
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
#!ruby | |
require 'serialport' | |
@port = SerialPort.new( | |
"/dev/tty.usbserial-A402PY11", | |
38400, | |
8, | |
1, | |
0 |
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
#!macruby | |
framework "Cocoa" | |
class MainView < NSView | |
def init | |
super | |
@log = "" | |
end |
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
if (foo) { | |
...; | |
} else | |
if (bar) { | |
...; | |
} else | |
if (baz) { | |
...; | |
} else { | |
...; |
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
function formatN (n) { | |
const unitList = ['y', 'z', 'a', 'f', 'p', 'n', 'u', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; | |
const zeroIndex = 8; | |
const nn = n.toExponential(2).split(/e/); | |
let u = Math.floor(+nn[1] / 3) + zeroIndex; | |
if (u > unitList.length - 1) { | |
u = unitList.length - 1; | |
} else | |
if (u < 0) { | |
u = 0; |
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
use Mouse::Meta::Class; | |
use JSON::XS; | |
sub TO_JSON { | |
my ($self) = @_; | |
my $klass = +Mouse::Meta::Class->initialize(ref $self); | |
+{ | |
map { | |
my $key = $_; | |
my $val = $self->{$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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use FindBin qw($Bin); | |
use lib "$Bin/../lib"; | |
use Teng::Schema::Dumper; | |
use String::Random qw(random_regex); | |
use Path::Class;; | |
my $file = shift or die "require sql file"; |