- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
sudo apt-get install xclip
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style type="text/css"> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0 } | |
#map_canvas { height: 100% } | |
</style> | |
<script type="text/javascript" |
class String | |
def scan_first(pattern) | |
a = self.scan(pattern) | |
a = a.first while a.is_a? Array unless a.empty? | |
return a | |
end | |
end | |
time_tokens = {} | |
given = ARGV[0] |
+(NSMutableArray *) loadRemoteListings { | |
NSMutableArray *listings = [NSMutableArray arrayWithCapacity:20]; | |
NSURL *url = [[NSURL alloc] initWithString:@"http://localhost:3000"]; | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; | |
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; | |
NSURLResponse *response; | |
NSError *error; |
javascript:(function() { | |
var script = document.createElement('script'); | |
script.onload = function() { | |
/* Remove existing stats if it exists */ | |
var existingStatsElement = document.getElementById('stats'); | |
if (existingStatsElement) { | |
existingStatsElement.parentNode.removeChild(existingStatsElement); |
class STL | |
class Writer | |
attr_accessor :tris, :size | |
def initialize tris | |
@tris = tris | |
@size = tris.length*50 + 80 + 4 | |
end | |
def write_stl_header f | |
80.times {|n| f << [0].pack("C") } #uint8 |
class Scene | |
attr_accessor :lights, :objects, :camera | |
def initialize | |
@lights = [] | |
@objects = [] | |
end | |
def add_light light | |
@lights.push light | |
end |
var createEngine = require('voxel-engine') | |
var game = createEngine({ | |
generate: function(x, y, z) { | |
if (x*x + y*y + z*z > 20*20) return 0; | |
return Math.floor(Math.random() * 4) + 1; | |
}, | |
texturePath: './', | |
materials: [ 'dirt', 'grass', 'crate', 'brick' ] | |
}); | |
game.appendTo('#container'); |
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 (x*x + y*y + z*z > 15*15) return 0 | |
return 3 | |
} | |
var game = createGame({ |
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 (x*x + y*y + z*z > 15*15) return 0 | |
return 3 | |
} | |
var game = createGame({ |