These are a list of usages of shell commands I can't live without on UNIX-based systems.
Using Homebrew
brew install pstree # to be able to use pstree
brew install vnstat # to be able to use vnstat
function interval () { | |
var lastTime = new Date().getTime() / 1000; | |
return function getInterval () { | |
var newTime = new Date().getTime() / 1000; | |
var delta = newTime - lastTime; | |
lastTime = newTime; | |
return delta; | |
}; | |
} |
<?php | |
//Larger images can require more memory and time | |
ini_set('memory_limit','2048M'); | |
ini_set('max_execution_time','300'); | |
//For testing purposes, I manually entered the input file name and destination folder | |
$destinationDir = 'tiles/'; | |
$fileName = 'map.jpg'; | |
if (!file_exists($destinationDir)) { |
var analyticsPath = /(stage|staging|dev|test|testing)[\.-]/.test(document.location.hostname) ? 'u/analytics_debug.js' : 'analytics.js'; | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/' + analyticsPath, 'ga'); | |
ga('create', 'UA-XXXXXX', { 'cookieDomain': 'none' }); | |
ga('send', 'pageview'); |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
# Builds a batch file that will run a Cygwin installer with the same packages currently installed | |
# on this system. Think of it as a package-list backup. | |
echo -n "setup-x86_64.exe -P " > update.bat | |
cygcheck -c -d | sed -e "1,2d" -e 's/ .*$//' | awk 'NR==1{printf $1}{printf ",%s", $1}' >> update.bat |
#!/usr/bin/env bash | |
set -e # exit on any nonzero command | |
read -n1 -r -p "Make sure SSH keys are set up on remotes. Press space to continue..." key | |
if [ "$key" = '' ]; then | |
# Remove default dotfiles that may exist | |
if [ -f "$HOME/.profile" ]; then | |
rm "$HOME/.profile" |
- Install XCode | |
- Make your user an admin | |
- Create SSH keys | |
$ ssh-keygen | |
- Upload public key to Assembla & Github | |
$ cat ~/.ssh/id_rsa.pub | pbcopy |
source "http://rubygems.org" | |
gem 'compass', '1.0' | |
gem 'sass', '3.4.4' | |
gem 'guard', '2.6.1' | |
gem 'guard-compass', '1.1.0' | |
gem 'guard-livereload', '2.3.1' | |
gem 'guard-bundler', '2.0.0' | |
gem 'yajl-ruby', '1.2.1' | |
gem 'sassy-buttons', '0.2.6' | |
gem 'closure-compiler', '1.1.11' |