Skip to content

Instantly share code, notes, and snippets.

View canering's full-sized avatar

eg canering

View GitHub Profile
@canering
canering / 0_reuse_code.js
Created August 2, 2016 07:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
! (C) 2013 Charles Alston.
USING: accessors arrays byte-arrays fry google.search io
io.encodings.utf8 io.launcher kernel locals make namespaces
sequences splitting strings unicode.categories vectors ;
FROM: webbrowser => open-file open-url ;
IN: spotlight
! *** searching on os x via spotlight metadata index, & managing indexing from factor ***
! *** mac os x 10.6.8 & later: implementing mdfind, mdls, mdutil, mdimport ***
! mdfind, mdls, mdutil, mdimport take a query on the stack
# System-wide .profile for sh(1)
# Comment out Apple's default - which is dog slow
# if [ -x /usr/libexec/path_helper ]; then
# eval `/usr/libexec/path_helper -s`
# fi
PATH=\
$HOME/bin:\
/usr/local/bin:\
@canering
canering / fixpaths.sh
Created September 10, 2016 10:11 — forked from erluko/fixpaths.sh
Fix the mess that /usr/libexec/path_helper made of my $PATH
#!/bin/sh
#Reorders $PATH, removes duplicates
prefixes="$1"
if [ '--' = "$prefixes" ]; then
shift;
prefixes="$1";
else
if echo "$prefixes" | grep -q '^\(\|--help\|-h\)$' ; then
#!/bin/bash
# Get Homebrew in the new location
git clone git@github.com:Homebrew/homebrew.git ~/Homebrew
# Move all your installed packages to the new location
mv /usr/local/Cellar ~/Homebrew/Cellar
mv /usr/local/Library ~/Homebrew/Library
# Remove "root" directory files left behind
rm -rf /usr/local/.git /usr/local/{.gitignore,.yardopts,CODEOFCONDUCT.md,CONTRIBUTING.md,LICENSE.txt,README.md,SUPPORTERS.md}
@canering
canering / node-and-npm-in-30-seconds.sh
Created September 13, 2016 04:39 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
sudo brew doctor
# Update HomeBrew
cd /usr/local && \
sudo git add . && \
sudo git reset --hard HEAD && \
sudo git pull --rebase
#!/usr/bin/env ruby
@canering
canering / .bash_profile
Created September 29, 2016 18:38 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@canering
canering / .gitconfig
Created September 30, 2016 00:49 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@canering
canering / osx-for-hackers.sh
Created September 30, 2016 03:23 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'