Skip to content

Instantly share code, notes, and snippets.

----- Update statistics by running the ANALYZE command on these tables -----
----- Tables missing statistics: campaigns78000295_v2 -----
XN Limit (cost=2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00..2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00 rows=1 width=52)
-> XN Merge (cost=2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00..2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00 rows=1 width=52)
-> XN Network (cost=2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00..2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00 rows=1 width=52)
-> XN Sort (cost=2999999999999999659174894884133939956615861204479803088453030456896447381288632370463183954715344896.00..299
function partial(fn /*, rest args */){
return fn.bind.apply(fn, Array.apply(null, arguments).slice(1));
}
const Logger = {
log(level, dateFormat, msg) {
console.log(level, dateFormat, msg);
}
};
function partial(fn /*, rest args */){
const newArgs = Array.apply(null, arguments).slice(1);
return function(){
const fnArgs = newArgs.concat(Array.apply(null, arguments));
fn.apply(null, fnArgs);
}
}
const Logger = {
log(level, dateFormat, msg) {
$("button").click(function(){
const which = $(this).data("which");
if(which == "bold"){
document.execCommand("bold");
}else if(which == "h3"){
document.execCommand("heading", false, "h3");
}else if(which == "ul"){
document.execCommand("insertUnorderedList");
}else if(which == "jqueryTable"){
@adatta02
adatta02 / diexample.ts
Created November 27, 2017 01:46
An example TypeScript DI system
import "reflect-metadata";
type Newable<T> = new (...args : any[]) => T;
class Injector {
private static constructedInstances : {cx: Newable<any>, object: any}[] = [];
public static inject<T>(originalConstructor : Newable<T>) : Newable<T> {
const paramTypes = Reflect.getOwnMetadata("design:paramtypes", originalConstructor);
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/server.ts"
}
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"noImplicitAny": true,
"strictNullChecks": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
$formMapper->get("menuVisibility")
->addModelTransformer(new CallbackTransformer(
function ($bitmarkToList) {
$options = [0b1, 0b10, 0b100];
for($i = 0; $i < count($options); $i++){
$options[$i] = $options[$i] & $bitmarkToList;
}
return $options;
},
function ($listToBitMask) {
Verifying that "adatta.id" is my Blockstack ID. https://explorer.blockstack.org/name/adatta.id
class HttpRequest {
private url : string;
}
function fromGlobals() : HttpRequest {
return {url: "http://www.setfive.com"};
}