Skip to content

Instantly share code, notes, and snippets.

View poga's full-sized avatar
💧
be water

Poga Po poga

💧
be water
View GitHub Profile
let p = console.log
function main (data) {
data.sort()
p(p1(data, null, 2020))
p(p2(data, 2020))
}
function p1 (data, skip, goal) {
let range_start = 0
let[@inline] get x i = String.unsafe_get x i |> Char.code
external unsafe_get_int16 : string -> int -> int = "%caml_string_get16u"
let[@inline] get16 x i = unsafe_get_int16 x i
let equal ~ln a b =
let l1 = ln asr 1 in
let r = ref 0 in
for i = 0 to pred l1 do r := !r lor (get16 a (i * 2) lxor get16 b (i * 2)) done ;
for _ = 1 to ln land 1 do r := !r lor (get a (ln - 1) lxor get b (ln - 1)) done ;

Keybase proof

I hereby claim:

  • I am poga on github.
  • I am poga (https://keybase.io/poga) on keybase.
  • I have a public key ASCGuHVZokHssUEj5B0UqilaYyepGHtKjqVZIPu2Sslgxwo

To claim this, I am signing this object:

@poga
poga / answer.go
Created April 9, 2019 06:25
pion-to-pion example, passing description without http server
package main
import (
"encoding/json"
"flag"
"fmt"
"net/http"
"time"
"strings"
// Tagged value 的 struct 定義
typedef LJ_ALIGN(8) union TValue {
uint64_t u64; /* 64 bit pattern overlaps number. */
lua_Number n; /* Number object overlaps split tag/value object. */
struct {
LJ_ENDIAN_LOHI(
union {
GCRef gcr; /* GCobj reference (if any). */
int32_t i; /* Integer value. */
Created civic-notebook/app/dist/
assets:list changed
Error: bankai.asset: could not find a file for
at /Users/poga/projects/bankai/index.js:158:26
at /Users/poga/projects/bankai/lib/queue.js:24:5
at Array.forEach (<anonymous>)
at Queue.ready (/Users/poga/projects/bankai/lib/queue.js:23:13)
at BufferGraph.<anonymous> (/Users/poga/projects/bankai/index.js:50:56)
at emitThree (events.js:135:13)
@poga
poga / _redirect1
Last active July 20, 2017 20:44
_redirect
# /users.json company=:filter /company-filtered/:filter/0.json 200!
/users.json page=:p /users-:p.json 200!
/users.json /users-0.json 200!
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name <YOUR DOMAIN NAME>;
return 301 https://$host$request_uri;
const hyperdrive = require('hyperdrive')
const swarm = require('hyperdiscovery')
const ram = require('random-access-memory')
var a1 = hyperdrive(ram)
var a2
a1.ready(function () {
swarm(a1)
a1.writeFile('/foo', 'bar', done)
a2 = hyperdrive(ram, a1.key)