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
exportDb = (name, cb) -> | |
handler = indexedDB.open(name) | |
handler.onsuccess = (sender) -> | |
db = sender.target.result | |
stores = db.objectStoreNames | |
results = {} | |
transaction = db.transaction stores, "readonly" |
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
saveAs: (name, data) -> | |
blob = new Blob [data] | |
url = URL.createObjectURL blob | |
# HTML5, jQuery, WebKit.. you all SUCK! | |
# (feels better now!) | |
$("<a>").attr(href: url, download: name).get()[0].click() |
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
# Description: | |
# A way to search images on giphy.com | |
# | |
# Configuration: | |
# HUBOT_GIPHY_API_KEY | |
# | |
# Commands: | |
# hubot gif (foo room) <query> - Returns an animated gif matching the requested search term. | |
# Sends result to rooms["foo"] if specified |
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
CREATE OR REPLACE FUNCTION concat_tsvectors(tsv1 tsvector, tsv2 tsvector) | |
RETURNS tsvector AS $$ | |
BEGIN | |
RETURN coalesce(tsv1, to_tsvector('default', '')) | |
|| coalesce(tsv2, to_tsvector('default', '')); | |
END; | |
$$ LANGUAGE plpgsql; | |
CREATE AGGREGATE tsvector_agg ( | |
BASETYPE = tsvector, |
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
.PHONY: clean all | |
x := cmx | |
i := cmi | |
V := @ | |
OCAMLOPT := ocamlfind ocamlopt | |
OCAMLDEP := ocamlfind ocamldep | |
OCAMLFLAGS := -g -linkpkg -package sedlex -package sedlex.ppx -package menhirlib |
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
--- /tmp/unicode63.ml 2019-06-18 11:01:28.000000000 +0200 | |
+++ _build/default/src/syntax/unicode.ml 2019-06-18 11:13:17.000000000 +0200 | |
@@ -1,144 +1,162 @@ | |
+let version = "12.1.0" | |
+ | |
module Categories = struct | |
- let cc = [0000, 0x1f; 0x7f, 0x9f] | |
+ let cc = | |
+ [0x85, 0x85; 0x7f, 0x9f; 0x9, 0xd; 0x0, 0x1f] |
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
module Def (S : Cstubs.Types.TYPE) = struct | |
let af_inet = S.constant "AF_INET" S.int | |
let af_inet6 = S.constant "AF_INET6" S.int | |
let af_unix = S.constant "AF_UNIX" S.int | |
let af_unspec = S.constant "AF_UNSPEC" S.int | |
let sa_data_len = S.constant "SA_DATA_LEN" S.int | |
let sa_family_len = S.constant "SA_FAMILY_LEN" S.int | |
let sock_dgram = S.constant "SOCK_DGRAM" S.int | |
let sock_stream = S.constant "SOCK_STREAM" S.int | |
let sock_seqpacket = S.constant "SOCK_STREAM" S.int |
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
let c_headers = " | |
#ifdef _WIN32 | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#else | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <netdb.h> | |
#endif | |
#define SA_DATA_LEN (sizeof(((struct sockaddr*)0)->sa_data)) |
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
include Ctypes | |
let lift x = x | |
open Ctypes_static | |
let rec field : type t a. t typ -> string -> a typ -> (a, t) field = | |
fun s fname ftype -> match s, fname with | |
| View { ty }, _ -> | |
let { ftype; foffset; fname } = field ty fname ftype in | |
{ ftype; foffset; fname } | |
| _ -> failwith ("Unexpected field "^ fname) |
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
(executable | |
(name gen_constants_c) | |
(modules gen_constants_c) | |
(libraries sys-socket.constants ctypes.stubs)) | |
(rule | |
(targets gen_constants.c) | |
(deps (:gen ./gen_constants_c.exe)) | |
(action (run %{gen} %{targets}))) |
OlderNewer