Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| function multiply(a, b) { | |
| return a * b; | |
| } | |
| function divide(a, b) { | |
| if (b === 0) { | |
| throw "Don't try to divide by zero!"; | |
| } | |
| return Math.round(a / b); |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
| #!/bin/bash | |
| # Functions ============================================== | |
| # return 1 if global command line program installed, else 0 | |
| # example | |
| # echo "node: $(program_is_installed node)" | |
| function program_is_installed { | |
| # set to 1 initially | |
| local return_=1 |
| # New repository | |
| mkdir <repo> && cd <repo> | |
| git init | |
| git remote add –f <name> <url> | |
| git config core.sparsecheckout true | |
| echo some/dir/ >> .git/info/sparse-checkout | |
| echo another/sub/tree >> .git/info/sparse-checkout | |
| git pull <remote> <branch> | |
| # Existing repository |
| sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 14, | |
| // font family with optional fallbacks |
| #' Simplified loading and installing of packages | |
| #' | |
| #' This is a wrapper to \code{\link{require}} and \code{\link{install.packages}}. | |
| #' Specifically, this will first try to load the package(s) and if not found | |
| #' it will install then load the packages. Additionally, if the | |
| #' \code{update=TRUE} parameter is specified it will check the currently | |
| #' installed package version with what is available on CRAN (or mirror) and | |
| #' install the newer version. | |
| #' | |
| #' @param pkgs a character vector with the names of the packages to load. |
| ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
| ### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget. | |
| ### You can download all the binaries one-shot by just giving the BASE_URL. | |
| ### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
| ### Script is updated for every JDK release. | |
| ### Features:- | |
| # 1. Resumes a broken / interrupted [previous] download, if any. | |
| # 2. Renames the file to a proper name with including platform info. |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |