brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| angular.module('demo').service('imageService', function ($http, $q, $timeout) { | |
| var NUM_LOBES = 3 | |
| var lanczos = lanczosGenerator(NUM_LOBES) | |
| // resize via lanczos-sinc convolution | |
| this.resize = function (img, width, height) { | |
| var self = { } | |
| self.type = "image/png" | |
| self.quality = 1.0 |
This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.
slow 3G # Slow network on default eth0 down to 3G wireless speeds
slow 3G -l 600ms -p 10% # slow network on eth0 and setup latency to 600ms packetloss to 10%
slow reset # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet with a high latency
slow dsl -b 1mbps # Simulate DSL with a slower speed than the default
The goal of this is to have an easily-scannable reference for the most common syntax idioms in JavaScript and Rust so that programmers most comfortable with JavaScript can quickly get through the syntax differences and feel like they could read and write basic Rust programs.
What do you think? Does this meet its goal? If not, why not?
JavaScript:
| var gulp = require('gulp'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var source = require('vinyl-source-stream'); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require('browserify'); | |
| var watchify = require('watchify'); | |
| var babel = require('babelify'); | |
| function compile(watch) { | |
| var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
| #!/bin/bash | |
| # Use this to quickly generate and sign certs for docker hosts, using the -c | |
| # option creates a cert that will allow client auth to the docker node. | |
| # | |
| # Before you use this you need to create the docker-ca certificates using | |
| # commands similart to this: | |
| # openssl genrsa -aes256 -out docker-ca-key.pem 2048 | |
| # openssl req -new -x509 -days 3650 -key docker-ca-key.pem -sha256 -out docker-ca.pem | |
| # | |
| # Then create the docker-ca.pass file and echo the docker-ca key password |