- Put these in a
$DOTFILES/zsh/functions
folder - Make sure completions is loaded in your ZSH
- Add functions path to the
fpath
in~/.zshenv
- Autoload the functions in your
~/.zshrc
# ~/.zshenv
fpath=(
import 'reflect-metadata'; | |
import { Type } from '@nestjs/common'; | |
import { plainToClass } from 'class-transformer'; | |
import { Conn } from './conn.decorator'; | |
import { ConnectionDetails } from './connection-details.interface'; | |
jest.mock('./connection.service', () => ({ | |
addConnectionDetails: () => {}, | |
})); |
#! /bin/bash | |
PROC=$1 | |
if [[ "$#" -lt 2 ]]; then | |
echo "Requires at least 2 arguments, the process name and at least one port number." | |
exit 1 | |
fi | |
for ip in "$@" |
function toTable(data, headings=[], cellspacing=2, cellpadding=1) { | |
const widths = data.concat([headings]).reduce((widths, r) => r.reduce((ws, c, i) => { | |
let cur = ws[i] || 0, w = String(c).length; | |
ws[i] = w > cur ? w : cur; | |
return ws; | |
}, widths), []).map(w => w + cellpadding * 2), cs = center('|', cellspacing + 1); | |
if(headings.length) { | |
console.log(headings.map((h, i) => pad(center(h, widths[i]))).join(cs)); | |
console.log(widths.map(w => '-'.repeat(w+cellpadding*2)).join(cs)); |
/** | |
* Executing the following in Chrome's console while viewing an organization's | |
* repositories will list available wiki pages for the those repostories. If | |
* paginated, you will have to repeat for each page. | |
*/ | |
function listWikis() { | |
return Promise.all($('li.source h3 a').map(src => { | |
const home = src.href + '/wiki'; | |
return new Promise(function(resolve) { | |
fetch(home, { credentials: 'include' }).then(r => r.text().then(t => { |
import { Adapter } from 'ember-pouch'; | |
import PouchDB from 'pouchdb'; | |
export default Adapter.extend({ | |
coalesceFindRequests: true, | |
init() { | |
this._super(...arguments); |
I hereby claim:
To claim this, I am signing this object:
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
actions: { | |
foo() { | |
alert("I'm the application route"); | |
} | |
} | |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
skillService: Ember.inject.service('skills'), | |
init: function() { | |
this._super.apply(this, arguments); | |