foo
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
#!/bin/bash -x | |
exec > /tmp/transcript.log 2>&1 | |
# This trick means the bash scripts logs its entire execution, | |
# both the commands executed and the output of those commands, | |
# to the transcript file. |
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
$headlessDataDir = "$( (Get-Location).Path )/headlessDataDir" | |
$devtoolsDataDir = "$( (Get-Location).Path )/devtoolsDataDir" | |
$remoteDebuggingPort = 9222 | |
$urlToInspect = https://www.example.com | |
# Open headless browser | |
& 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' "--user-data-dir=$headlessDataDir" --headless --remote-debugging-port=$remoteDebuggingPort $urlToInspect | |
# Open DevTools | |
& 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' "--user-data-dir=$devtoolsDataDir" "http://localhost:$remoteDebuggingPort" |
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
# Recipe for deleting old, merged branches from a remote repository | |
# delete stuff already merged into this branch... | |
$developBranch = 'develop' | |
# ...and whose most recent commit is older than this... | |
$ifOlderThan = [datetime]'06-01-2017' | |
# ...on this remote | |
$remote = 'origin' | |
# Get list of all remote branches already merged into develop |
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
import {unique} from 'lodash'; | |
import * as path from 'path'; | |
/* | |
* Grunt copy task that's faster by eliminating unnecessary or redundant fs calls. | |
* | |
* Things it does *not* do: | |
* - set or copy file mode / permissions | |
* - "process"ing files | |
* - "process"ing files as raw buffers |
To reproduce:
$ npm install
$ npm run tsc
# tsc emits all code to tsc-out as expected
$ npm run webpack
# Errors indicate that it can't find either .jsx files but it can find the .js files
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
#!/usr/bin/env bash | |
npm install stylus | |
# Dump all output into log.txt | |
exec > >(tee -i zlog.txt) | |
exec 2>&1 | |
### Bug reproduction: | |
echo ==================================================================================== |
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"; | |
const stylus = require('stylus'); | |
const path = require('path'); | |
const fs = require('fs'); | |
if(['before', 'after'].indexOf(process.argv[2]) === -1) throw new Error('bad argument'); | |
const getDepsBeforeRender = process.argv[2] === 'before'; | |
const files = [ |
Sails and Trails current directory structures look like this:
/api/...
/config/...
/assets/...
The server executes code directly from the source code directory. It executes the same code files that are stored in version control.
When using compiled languages, we need to convert our TypeScript, CoffeeScript, ES2015, etc files to .js
. Naively, we might add a few .gitignore rules:
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
var oboe = require('oboe'); | |
var stream = require('stream'); | |
var Readable = stream.Readable; | |
var Writable = stream.Writable; | |
var readable = new Readable(); | |
readable._read = function() {}; | |
readable.push('{"some": "json"}{"more": [1, 2, 3], "json": true}{"final json object": 12345}{"stream continues...'); | |
readable.push(null); |