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
# backup from Docker container | |
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
# restore to Docker container | |
cat dump.sql | docker exec -i postgres-container-id psql -U postgres |
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 toPlain = response => { | |
const flattenDataValues = ({ dataValues }) => | |
_.mapValues(dataValues, value => ( | |
_.isArray(value) && _.isObject(value[0]) && _.isObject(value[0].dataValues) | |
? _.map(value, flattenDataValues) | |
: _.isObject(value) && _.isObject(value.dataValues) | |
? flattenDataValues(value) | |
: 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 DiscoveryV1 = require('watson-developer-cloud/discovery/v1'); | |
const discovery = new DiscoveryV1({ | |
username: USERNAME, | |
password: PASSWORD, | |
version_date: '2017-09-01', | |
}); | |
const query = callback => { | |
discovery.query({ |
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
Show hidden characters
{ | |
"user": { | |
"debug": false, | |
"delay": 2, | |
"error_color": "E74C3C", | |
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", | |
"gutter_theme_excludes": [], | |
"lint_mode": "load/save", | |
"linters": { | |
"eslint": { |
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
// transform css to stylus | |
(\s{|}\n|}$|:|;) |
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
gulp.task('watch:package', function () { | |
gulp.src('../../package/source/lib/package.js') | |
.pipe(watch('../../package/source/lib/package.js')) | |
.pipe(shell('cd ../../package/source/ && jspm link github:evenfrost/package@dev -y')) | |
.pipe(gulp.dest('')); | |
}); |
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
(() => { | |
'use strict'; | |
let collections = Meteor.connection._mongo_livedata_collections; | |
let names = Object.keys(collections); | |
let result = {}; | |
for (let name of names) { | |
let collection = Meteor.connection._mongo_livedata_collections[name]; | |
let keys = Object.keys(collection._docs._map); |
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
(() => { | |
'use strict'; | |
let copy = () => { | |
let area = document.createElement('textarea'); | |
let notificaitons = angular.element('*[ng-app]').injector().get("uiNotifications"); | |
let titles = []; | |
let dateArray = new Date().toJSON().slice(0, 10).split('-'); | |
let date = [dateArray[1], dateArray[2], dateArray[0]].join('/'); |
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
/** | |
* Sets emoji icons for tasks. | |
*/ | |
var emojize = function () { | |
var tasks = Array.prototype.slice.call(document.querySelectorAll('.checklist-item:not(.checklist-item-state-complete)')), | |
i = 0, | |
len = tasks.length, | |
replacers = [ | |
{ | |
from: '/^low:\s/', |
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
/** | |
* Clears all cokies from bandcamp site. | |
*/ | |
(function () { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = cookies[i].trim(); | |
var eqPos = cookie.indexOf('='); | |
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; |