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 $w(e) { | |
return (e = e.strip()) ? e.split(/\s+/) : [] | |
} | |
function $H(e) { | |
return e && e.constructor == Hash ? e : new Hash(e) | |
} | |
function $(e) { | |
if (1 < arguments.length) { |
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 bash | |
# set -euxo pipefail | |
set -euo pipefail | |
die() { | |
printf "%s\n" "$*" > "$(tty)" | |
exit 1 | |
} |
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
authority letsencrypt { | |
api url "https://acme-v02.api.letsencrypt.org/directory" | |
account key "/etc/acme/letsencrypt-privkey.pem" | |
} | |
# example.net | |
domain example.net { | |
alternative names { www.example.net } | |
domain key "/etc/ssl/private/example.net.key" | |
domain certificate "/etc/ssl/example.net.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
def solution(a) | |
total = a.size | |
lindex = a.size-1 | |
sorted = a.sort | |
min = total | |
combos = [] | |
return 0 if a == sorted | |
(2..total).each do |pair_size| |
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 myLib = (function(){ | |
this.libName = 'in lib'; | |
let obj = { | |
libName: 'in obj', | |
toCaps() { | |
return this.libName.toUpperCase(); | |
} | |
}; |
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
class Watcher { | |
constructor(vm, valueFn) { | |
this.vm = vm; | |
this.getter = valueFn; | |
this.value = this.get(); | |
} | |
get() { | |
let value; |
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
const Watcher = require('./watcher'); | |
const noop = function () {}; | |
const sharedPropDef = { | |
enumerable: true, | |
configurable: true, | |
get: noop, | |
set: noop | |
}; |
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
// https://vuejs.org/v2/guide/instance.html | |
// | |
// | |
//function Vue(opts){ | |
//for(var key in opts.data){ | |
//this[key] = opts.data[key] | |
//} | |
//} | |
function Vue(opts){ | |
this._data = opts.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
class XMLBuilder | |
def initialize | |
@d = {} | |
end | |
def to_xml | |
@d | |
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
// this is function definition. | |
// you can make a function take zero or more arguments (also called as parameters) | |
// This Dog fn takes one argument: 'name' | |
function Dog(name){ | |
return "hello, my name is: " + name; | |
} | |
// calling the Dog function | |
Dog('tommy'); // this will return "hello, my name is: tommy" |
NewerOlder