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
#![feature(asm)] | |
trait FindFirstBit { | |
fn ffs(&self) -> u8; | |
} | |
#[inline(always)] | |
fn supports_asm() -> bool { | |
cfg!(any( | |
target_arch = "x86", |
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
use "net" | |
use "net/ssl" | |
use "collections" | |
actor HttpClient | |
let _env: Env | |
let _ssl_ctx: SSLContext | |
embed _connections: Map[String, _HttpConnection] = _connections.create() | |
new create(env: Env) => |
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
use "regex" | |
class Rule[T] | |
let name: String | |
let regex: String | |
let _create: {(String): T^} | |
new create(name': String, regex': String, make: {(String): T^}) => | |
name = name' | |
regex = regex' |
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
primitive Unsafe | |
fun gc() => | |
@pony_triggergc[None](@pony_ctx[USize]()) | |
fun usize[T](value: T): USize => | |
Unsafe.ptr[T](consume value).usize() | |
fun ptr[T](value: T): Pointer[T] => | |
@memcpy[Pointer[T]](value, USize(0), USize(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
const Sql = require('mysql'); | |
const Express = require('express'); | |
const app = Express(); | |
const port = process.argv[6] || '8080'; | |
const database = process.argv[5]; | |
const pool = Sql.createPool({ | |
database: database, | |
connectionLimit: 10, | |
host: process.argv[2], |
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
use @pony_ctx[Ptr]() | |
use @pony_alloc[Ptr](ctx: Ptr tag, size: USize) | |
use @pony_realloc[Ptr](ctx: Ptr tag, ptr: Ptr tag, size: USize) | |
use @memcpy[Ptr](dest: USize, src: USize, bytes: USize) | |
use @memmove[Ptr](dest: USize, src: USize, bytes: USize) | |
type Ptr is Pointer[U8] | |
type Option[T] is (T | None) | |
interface ByteArray |
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 Data.Map (Map) | |
import Text.Read (readMaybe) | |
import Data.List (isPrefixOf) | |
import qualified Data.Map as Map | |
import Data.Char (isSpace, isNumber, isAlpha) | |
data Json = | |
JNull | | |
JBool Bool | | |
JInt Integer | |
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
{- | |
King - 1/11/2018 | |
Resources Used: | |
- Haskell quick docs: https://www.haskell.org/hoogle/ | |
- Operator precedence: http://ee.hawaii.edu/~tep/EE160/Book/chap5/_28291_table577.gif | |
- Precedence climbing: http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing | |
-} | |
module Main where |
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 os | |
import sys | |
import shutil | |
CC = "ghc" | |
EXT = '.hs' | |
BINARY = 'app' | |
SAME_DIR = True | |
SRC_DIR = os.path.join(os.getcwd(), 'src') | |
BUILD_DIR = os.path.join(os.getcwd(), 'build') |
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
""" | |
JPack: The most of JSON and erlpack/etf | |
____.__________ _____ _________ ____ __. | |
| |\______ \/ _ \ \_ ___ \| |/ _| | |
| | | ___/ /_\ \/ \ \/| < | |
/\__| | | | / | \ \___| | \ | |
\________| |____| \____|__ /\______ /____|__ \ | |
\/ \/ \/ | |
Copyright(c) 2017 king1600 (https://github.com/king1600) |
NewerOlder