Command: heroku pg:backups capture -a [app_name]
Command: curl -o latest.dump `heroku pg:backups public-url -a [app_name]`
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var styleEl = document.getElementById('css-layout-hack'); | |
if (styleEl) { | |
styleEl.remove(); | |
return; | |
} | |
styleEl = document.createElement('style'); | |
styleEl.id = 'css-layout-hack'; |
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes |
#!/bin/bash | |
# Download GitKraken | |
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz | |
# copy the downloaded file into /opt directory | |
cp gitkraken-amd64.tar.gz /opt/ | |
cd /opt |
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
// Returns black or white foreground color depending on the background | |
var textColor = function (backgroundColor) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(backgroundColor); | |
if (!result) { | |
return '#000000';//Happens when not given hex | |
} | |
var shade = (parseInt(result[1], 16) + parseInt(result[2], 16) + parseInt(result[3], 16)) / 3; | |
return shade > 128 ? '#000000' : '#FFFFFF'; | |
} |
// Get element offset from top of page | |
function getOffset(el) { | |
el = el.getBoundingClientRect(); | |
return { | |
left: el.left + window.scrollX, | |
top: el.top + window.scrollY | |
}; | |
}; |
import {Injectable, EventEmitter} from 'angular2/core'; | |
@Injectable() | |
export class EmitterService { | |
private static _emitters: { [ID: string]: EventEmitter<any> } = {}; | |
static get(ID: string): EventEmitter<any> { | |
if (!this._emitters[ID]) | |
this._emitters[ID] = new EventEmitter(); | |
return this._emitters[ID]; |