Skip to content

Instantly share code, notes, and snippets.

View thestonefox's full-sized avatar

The Stonefox thestonefox

View GitHub Profile
@thestonefox
thestonefox / thestonefox-vimrc
Last active May 29, 2019 07:02
Basic .vimrc with pathogen, solarized theme, nerdtree
execute pathogen#infect()
syntax on
set number
set expandtab
set tabstop=2
set background=dark
set t_Co=256
let g:solarized_termcolors=256
let g:solarized_termtrans=1
@thestonefox
thestonefox / thestonefox-solarized-tmux
Created February 8, 2014 13:17
Alternative Solarized tmux theme
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
@thestonefox
thestonefox / docker-root-ssh-access
Created February 21, 2014 14:27
SSH Access For Docker
#Setup SSH Access
RUN apt-get -q -y update
RUN apt-get install -q -y openssl whois openssh-server vim nano
RUN mkdir -p /root/.ssh
RUN chown -R root:root /root/.ssh
RUN chmod -R 600 /root/.ssh/
RUN mkdir -p /var/run/sshd
RUN printf "#!/bin/bash \
\n echo \"root:password\" |chpasswd \
@thestonefox
thestonefox / docker-service-manager
Created February 21, 2014 14:46
Docker container management script to start, stop and restart containers from source
#!/bin/bash
function start() {
docker build -rm -t myapp_image .
docker run -d -name myapp_container myapp_image
}
function stop() {
docker stop myapp_container && docker rm myapp_container
}
@thestonefox
thestonefox / env_setup.sh
Last active August 29, 2015 14:05
Base Environment Setup
#!/bin/bash
echo "Moving to home directory"
cd ~/
echo "Setting up git defaults"
git clone https://github.com/thestonefox/git-config.git
ln -s git-config/.gitconfig ~/.gitconfig
ln -s git-ignore/.gitignore ~/.gitignore
git-config/helpers.sh
@thestonefox
thestonefox / nodejs-install
Last active August 29, 2015 14:15
Ubuntu NodeJS Install (Requires sudo su)
apt-get install -y python-software-properties python &&
add-apt-repository ppa:chris-lea/node.js &&
echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list &&
apt-get -q -y update &&
apt-get install -y nodejs
@thestonefox
thestonefox / phantomjs-install
Created February 11, 2015 09:16
Install PhantomJS (Run as sudo su)
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&
mv phantomjs-1.9.7-linux-x86_64.tar.bz2 /usr/local/share/. &&
cd /usr/local/share/ &&
tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 &&
ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64 /usr/local/share/phantomjs &&
ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/bin/phantomjs
@thestonefox
thestonefox / apt-install
Created February 12, 2015 07:01
Recommended Ubuntu Dependencies
sudo apt-get update && sudo apt-get install git-core curl git build-essential libssl-dev libreadline-dev autoconf bison libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libncurses5-dev automake libtool libpq-dev fontconfig docker.io
@thestonefox
thestonefox / ViveCursor.cs
Last active June 5, 2019 20:54
A basic implementation of a laser pointer for the HTC Vive controllers in Unity3D
using UnityEngine;
using System.Collections;
public class ViveCursor : MonoBehaviour {
public enum AxisType
{
XAxis,
ZAxis
}
@thestonefox
thestonefox / SteamVR_FirstPersonController.cs
Last active March 13, 2017 11:49
A Unity3d 5.3 script to add SteamVR functionality such as object interaction/grabbing/throwing, laser pointer and teleport movement with blink (Requires Unity SteamVR plugin)
//=============================================================================
//
// Purpose: Add player ability on SteamVR CameraRig to:
//
// * Trackpad press down: project laser pointer from Touch Controller
// * Trackpad release: teleport player with blink to laser point destination
// * Trigger click: grab any object that has a custom "Grabbable" tag applied
// * Trigger release: release the current grabbed object with relative force
// * Application Menu: reset the position of last grabbed object to controller
//