Skip to content

Instantly share code, notes, and snippets.

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
'**/test/file-i-am-debugging.ts',
],
testPathIgnorePatterns: [
@qcom
qcom / git-filter-branch-move-files.md
Created June 8, 2020 14:37 — forked from fabiomaggio/git-filter-branch-move-files.md
Use git filter-branch to move all projects files to a subdir and rewrite all commits
  1. Clone project

  2. Checkout all branches that contain the files that should be moved

  3. Delete the remote

  4. Run the filter-branch command:

    git filter-branch --tree-filter 'mkdir -p /path/to/tmp; mv * /path/to/tmp; mkdir subdir; mv /path/to/tmp/* subdir/' --tag-name-filter cat --prune-empty -- --all
    • All files are first copied to a temporary dir and move from there to the new destination
  • Existing tags are updated
US wall power outlet <–––> Transformer [hard-wired power cord; male]
Transformer [OUTPUT 220V port; female] <–––> UK power cord [male]
UK power cord [female] <–––> Technics [AC power socket]
@qcom
qcom / out
Created March 22, 2016 21:49
> err
{ handle: 2,
type: 'error',
className: 'Error',
constructorFunction: { ref: 10 },
protoObject: { ref: 11 },
prototypeObject: { ref: 1 },
properties:
[ { name: 'stack', attributes: 2, propertyType: 3, ref: 1 },
{ name: 'message', attributes: 2, propertyType: 0, ref: 12 },
gulp.task('jsx', function() {
return browserify({
entries: paths.reactEntryPoints,
extensions: ['jsx'],
debug: true
}).transform(babelify.configure({
presets: ['es2015', 'stage-1', 'react']
})).bundle()
.on('error', function(err) { console.error(err.message); this.emit('end'); })
.pipe(source('components.js'))
@qcom
qcom / bookshelf.js
Created November 25, 2015 18:09
bookshelf initialization
var config = require('config');
var knex = require('knex')({
client: 'pg',
connection: config.get('postgresConnstring'),
debug: process.env.NODE_ENV === 'development'
});
var bookshelf = require('bookshelf')(knex);
'use strict';
var request = require('request');
var url = 'https://google.com';
module.exports = function(address, cb) {
request(url, function(err, res, body) {
if (err) throw err;
console.log(body);
});
@qcom
qcom / out.txt
Created September 27, 2015 20:13
longjohn stack trace with NODE_DEBUG=net,tls
NET 84539: _read
NET 84539: Socket._read readStart
NET 84539: _read
NET 84539: Socket._read readStart
NET 84539: _read
NET 84539: Socket._read readStart
NET 84539: destroy undefined
NET 84539: destroy
NET 84539: close
NET 84539: close handle
@qcom
qcom / out.txt
Created September 27, 2015 19:22
longjohn stack trace
[127.0.0.1] GET /search?search=92119&option=location @2015-09-27T12:18:39-07:00
{ [Error: error 209.242.169.194 GET /search?search=92119&option=location]
code: 'ECONNRESET',
level: 'error',
timestamp: '2015-09-27T19:18:39.318Z' }
Error: socket hang up
at TLSSocket.onHangUp (_tls_wrap.js:1032:19)
at TLSSocket.g (events.js:260:16)
at emitNone (events.js:72:20)
at TLSSocket.emit (events.js:166:7)
@qcom
qcom / Rater.js
Created September 20, 2015 09:24
class Rater {
constructor() {
}
}
module.exports = Rater;