- Database-as-a-Service for MongoDB https://mlab.com/
- Homebrew package manager http://brew.sh/
- Steps to install MongoDB on OSX https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
""" | |
Copyright (c) 2009, Aaron Bycoffe | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
# Bikes Factory | |
b1 = {brand: "scott", year: 2016, color: "red"} | |
b2 = {brand: "specialized", year: 2016, color: "blue"} | |
b3 = {brand: "Releigh", year: 2016, color: "white"} | |
arr = Bike.create_bikes_array([b1, b2, b3]) | |
# arr = [< Instance of Bike 1>, <Instance of Bike 2>, <Instance of Bike 3>] | |
# Stretch print: ["scott", "specialized", "Releigh"] |
// Functions | |
function hello() { | |
console.log("Hello World") | |
} | |
// Calling a function | |
hello // function | |
hello() // "Hello World" | |
// Returning from functions |
(function() { | |
// | |
// Iterates over an array of numbers and returns the sum. Example: | |
// | |
// _.sum([1, 2, 3]) => 6 | |
// | |
_.sum = function(obj) { | |
if (!$.isArray(obj) || obj.length == 0) return 0; | |
return _.reduce(obj, function(sum, n) { |
#!/bin/sh | |
# check for where the latest version of IDEA is installed | |
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
wd=`pwd` | |
# Setup your working directory. Edit 'work' to your working directory. | |
working_dir=`ls -1d ~/work/$1 | head -n1` | |
# were we given a directory? | |
if [ -d "$1" ]; then |
Pluralize or singular string based on a number
Handlebars.registerHelper('pluralize', function(number, singular, plural) {
if (number === 1) {
return singular;
} else {
return (typeof plural === 'string' ? plural : singular + 's');
}
});
# User settings - Here you can enable/disable a given miner profile: | |
# | |
RUNAS="ubuntu" # For the amdgpu-pro driver this user must be a member of 'video' group | |
DAEMON="/opt/miners/ethminer" # Wherever you installed the binary - make sure its executable by above user. | |
GPU="-G" # -U (nVidia Cuda) or -G (OpenCL) or -X (mixed Cuda/OpenCL cards) | |
WORKER="Worker1" | |
LOGFILE="/var/log/miners/ethminer.log" | |
# values: pool, proxy, solo |
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 3 | |
Comment=Edit text files | |
Exec=/usr/local/sublime-text-3/sublime_text | |
Icon=/usr/local/sublime-text-3/Icon/128x128/sublime_text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" |
function loadGists() { | |
var els = $('code[gist]'), gists = {}, code = [], stylesheets = []; | |
// Get elements referencing a gist and build a gists hash referencing the elements that use it | |
els.each(function(idx, rawEl) { | |
var el = $(rawEl), gist = el.attr('gist'); | |
rawEl.gist = gist; | |
rawEl.file = el.attr('file'); | |
gists[gist] = gists[gist] || { targets: [] }; | |
gists[gist].targets.push(el); | |
}); |