Skip to content

Instantly share code, notes, and snippets.

@sethvincent
sethvincent / git-config.sh
Last active July 16, 2017 20:58
setting up git
#!/bin/bash
# download this file to your vagrant box:
# wget https://gist.githubusercontent.com/sethvincent/1754789/raw/git-config.sh
# curl -o- https://gist.githubusercontent.com/sethvincent/1754789/raw/git-config.sh | bash
# run this script to set up git:
# sh ./git-config.sh
@sethvincent
sethvincent / .bashrc
Last active July 16, 2017 21:30
.bashrc
ulimit -n 10240
export JOBS=max
export CLICOLOR=1
# aliases
alias l="ls -al"
alias ws="cd ~/workspace"
alias g="git add . && git commit -m"
alias nr="npm run"
@sethvincent
sethvincent / Gemfile
Created March 15, 2012 00:29
sinatra, omniauth, and datamapper
source :rubygems
gem 'foreman'
gem 'oa-oauth'
gem 'dm-core'
gem 'dm-sqlite-adapter'
gem 'dm-migrations'
gem 'rack', "~> 1.3.6"
gem 'sinatra'
gem 'thin'
@sethvincent
sethvincent / index.js
Last active December 12, 2015 08:38
voxel.js game
var createGame = require('voxel-engine')
function weirdWorld(x, y, z) {
// return the index of the material you want to show up
// 0 is air
//silly random
if (x*x*Math.random()*0.33 + y*y*Math.random()*3.33 + z*z*Math.random()*7 > 15*15) return 0
return 4
}
@sethvincent
sethvincent / index.js
Created February 27, 2013 00:46
voxel.js game
// http://natureofcode.com/book/chapter-8-fractals/#chapter08_example8 but doesn't work yet
var createGame = require('voxel-engine')
function sphereWorld(x, y, z) {
// return the index of the material you want to show up
// 0 is air
if (y === 1) return 1
return 0
}
<style>
.team-member {
min-height:160px;
border-bottom:1px solid #ececec;
margin-bottom: 25px;
}
.team-member img {
float: left;
margin-right: 20px;
@sethvincent
sethvincent / dpadexample.java
Created March 31, 2013 03:58
Example of using the d-pad with libgdx. Works with Ouya. Also works with wasd keys for desktop.
if(Gdx.input.isKeyPressed(Keys.DPAD_LEFT) || Gdx.input.isKeyPressed(Keys.A)) {
player.x -= playerSpeed * Gdx.graphics.getDeltaTime();
}
if(Gdx.input.isKeyPressed(Keys.DPAD_RIGHT) || Gdx.input.isKeyPressed(Keys.D)) {
player.x += playerSpeed * Gdx.graphics.getDeltaTime();
}
if(Gdx.input.isKeyPressed(Keys.DPAD_UP) || Gdx.input.isKeyPressed(Keys.W)) {
player.y += playerSpeed * Gdx.graphics.getDeltaTime();
@sethvincent
sethvincent / getemails.js
Last active December 17, 2015 12:18
just give me the damn emails.
var emailEls = $('tr td:last-child').filter(function(){
return $(this).html().length > 0;
});
var email;
var emails = [];
$.each(emailEls, function(k,v){
email = $(v).text();
if ( $.inArray( email, emails ) === -1 ){
@sethvincent
sethvincent / index.js
Created July 8, 2013 22:12
made with requirebin.com
var Game = require('crtrdg-gameloop');
var canvas = document.createElement('canvas');
canvas.id = 'game';
var body = document.getElementsByTagName('body')[0];
body.appendChild(canvas);
var game = new Game({
canvasId: 'game',
@sethvincent
sethvincent / index.js
Created July 18, 2013 17:54
requirebin sketch
var inherits = require('inherits');
var Game = require('crtrdg-gameloop');
var Entity = require('crtrdg-entity');
var Keyboard = require('crtrdg-keyboard');
var canvas = document.createElement('canvas');
canvas.id = 'game';
var body = document.getElementsByTagName('body')[0];