This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
| #!/usr/bin/env node | |
| 'use strict'; | |
| // Program accepts only json array string on stdin | |
| // You need node.js with version >= v6.2.2 | |
| // Examples of usage: | |
| // | |
| // $ echo "[1,2,[3,4],[5,[6],7],8]" | node flatten.js | |
| // [1,2,3,4,5,6,7,8] |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
| #!/usr/bin/env node | |
| // Save hook under `project-root/hooks/before_prepare/` | |
| // | |
| // Don't forget to install xml2js using npm | |
| // `$ npm install xml2js` | |
| var fs = require('fs'); | |
| var xml2js = require('xml2js'); |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
| package main | |
| import ( | |
| "crypto/tls" | |
| "golang.org/x/crypto/acme/autocert" | |
| "log" | |
| "net" | |
| "net/http" | |
| ) |
Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.
NOTE: Unfortunately this is somewhat out of date. The comments link to some resources that may be more up-to-date. Patches welcome.
These can be used for nefarious purposes and to bypass access restrictions.
| echo 'Formatting the code base...' | |
| godep go fmt $(go list ./... | grep -v /vendor/) | |
| echo 'Optimizing the imports...' | |
| goimports -w $(go list -f {{.Dir}} ./... | grep -v /vendor/) | |
| echo 'Installing dependencies. This might take some time...' | |
| godep go install $(go list ./... | grep -v /vendor/) | |
| echo "Executing test" |