See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| #!/bin/bash | |
| ################ | |
| # Uncomment if you want the script to always use the scripts | |
| # directory as the folder to look through | |
| #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| REPOSITORIES=`pwd` | |
| IFS=$'\n' |
| # ipak function: install and load multiple R packages. | |
| # check to see if packages are installed. Install them if they are not, then load them into the R session. | |
| ipak <- function(pkg){ | |
| new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
| if (length(new.pkg)) | |
| install.packages(new.pkg, dependencies = TRUE) | |
| sapply(pkg, require, character.only = TRUE) | |
| } |
| <?php | |
| /** | |
| * Require the library | |
| */ | |
| require 'PHPTail.php'; | |
| /** | |
| * Initilize a new instance of PHPTail | |
| * @var PHPTail | |
| */ | |
| $tail = new PHPTail("/path/to/log"); |
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |
| # check.packages function: install and load multiple R packages. | |
| # Check to see if packages are installed. Install them if they are not, then load them into the R session. | |
| check.packages <- function(pkg){ | |
| new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
| if (length(new.pkg)) | |
| install.packages(new.pkg, dependencies = TRUE) | |
| sapply(pkg, require, character.only = TRUE) | |
| } | |
| # Usage example |
| /* (320x480) iPhone (Original, 3G, 3GS) */ | |
| @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { | |
| /* insert styles here */ | |
| } | |
| /* (320x480) Smartphone, Portrait */ | |
| @media only screen and (device-width: 320px) and (orientation: portrait) { | |
| /* insert styles here */ | |
| } | |
| // create an IAM Lambda role with access to dynamodb | |
| // Launch Lambda in the same region as your dynamodb region | |
| // (here: us-east-1) | |
| // dynamodb table with hash key = user and range key = datetime | |
| console.log('Loading event'); | |
| var AWS = require('aws-sdk'); | |
| var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
| exports.handler = function(event, context) { |
| # A ternary operator in R. | |
| if (!is.element("super", installed.packages()[,1])) { devtools::install_github("robertzk/super") } | |
| `?` <- function(expr1, expr2) { | |
| if (missing(expr2)) { | |
| super::super(expr1) | |
| } else { | |
| expr2 <- substitute(expr2) | |
| if (!(is.call(expr2) && identical(expr2[[1]], as.name(":")))) { | |
| super::super(expr1, expr2) |
| -- This is v0.6 of the custom script for AlfredApp for iTerm 2.9+ | |
| -- Please see https://github.com/stuartcryan/custom-iterm-applescripts-for-alfred/ | |
| -- for the latest changes. | |
| -- Please note, if you store the iTerm binary in any other location than the Applications Folder | |
| -- please ensure you update the two locations below (in the format of : rather than / for folder dividers) | |
| -- this gets around issues with AppleScript not handling things well if you have two iTerm binaries on your system... which can happen :D | |
| on alfred_script(q) | |
| if application "iTerm2" is running or application "iTerm" is running then |