CLICK ME
yes, even hidden code blocks!
print("hello world!")
#!/usr/bin/env node | |
console.log('yay gist') |
set-option -g mouse on | |
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'" | |
# Resize panes with arrow keys because alt-arrow keys doesn't work | |
bind-key -r Up resize-pane -U | |
bind-key -r Down resize-pane -D | |
bind-key -r Left resize-pane -L | |
bind-key -r Right resize-pane -R |
# install epel-release on centos | |
yum -y install epel-release | |
yum -y update | |
# install python-pip from epel | |
yum -y install python-pip | |
# Verify using: | |
pip -V |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
module.exports = (string) => { | |
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase(); | |
}; |
capabilities: [ | |
{ browserName: 'phantomjs', | |
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54", | |
"proxy": { | |
"proxyType":"MANUAL", | |
"httpProxy":"HOST:PORT" | |
} | |
} | |
] | |
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
... | |
... | |
providers: [ | |
{ provide: Http, useClass: ExtendedHttpService } | |
] | |
... | |
... |
import { join } from 'path' | |
import { readdir, stat } from 'fs-promise' | |
async function rreaddir (dir, allFiles = []) { | |
const files = (await readdir(dir)).map(f => join(dir, f)) | |
allFiles.push(...files) | |
await Promise.all(files.map(async f => ( | |
(await stat(f)).isDirectory() && rreaddir(f, allFiles) | |
))) | |
return allFiles |