This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.sortByMeasurement = function(child_type){ | |
var element = this; | |
if(!child_type) child_type = "li"; | |
var SINGLE_REGEX = /\s*(\d*)?([\.\/])?(\d*)\s*([a-zA-z]*)/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#confirmation-overlay { | |
position: absolute; | |
width: 100%; | |
height:100%; | |
background: rgba(0,0,0,0.5); | |
top:0; | |
left:0; | |
line-height:18px; | |
font-size:18px; | |
z-index:100000000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import atexit | |
def initController(): | |
port = serial.Serial( | |
port='/dev/tty.usbmodem1411', | |
baudrate=9600 | |
) | |
closePort(port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+================================================ | |
+ | |
+ Vectric machine output configuration file | |
+ | |
+================================================ | |
+ | |
+ History | |
+ | |
+ Who When What | |
+ ======== ========== =========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// QUESTION: For some reason Devise only sees auth token when passed through url not as param | |
// WHY? this seems really insecure... | |
-(NSString *) concatURL { | |
NSString *base = @"http://localhost:3000"; | |
NSString *auth = [[NSUserDefaults standardUserDefaults] objectForKey:@"token"]; | |
return [NSString stringWithFormat:@"%@?auth_token=%@", base, auth]; | |
} | |
-(NSDictionary *) postListing { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( window.devicePixelRatio !== 1 ){ | |
var c = canvas.getElement(); // canvas = fabric.Canvas | |
var w = c.width, h = c.height; | |
// Scale the canvas up by two for retina | |
// just like for an image | |
c.setAttribute('width', w*window.devicePixelRatio); | |
c.setAttribute('height', h*window.devicePixelRatio); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://stackoverflow.com/questions/7553726/blender-how-to-export-shape-keys-using-python | |
#and three js blender exporter | |
import bpy | |
import json | |
# monkeypatch the json encoder to truncate floats | |
# http://stackoverflow.com/questions/1447287/format-floats-with-standard-json-module | |
from json import encoder | |
encoder.FLOAT_REPR = lambda o: format(o, '.15g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+================================================ | |
+ | |
+ Vectric machine output configuration file | |
+ | |
+================================================ | |
+ | |
+ History | |
+ | |
+ Who When What | |
+ ======== ========== =========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Paul Kaplan, @ifitdidntwork | |
Create an ASCII STL file from a THREE.js mesh | |
that can be saved save from browser and 3D printed | |
-------------------------------------------------- | |
See further explanation here: | |
http://buildaweso.me/project/2013/2/25/converting-threejs-objects-to-stl-files | |
-------------------------------------------------- | |
Saving the file out of the browser is done using FileSaver.js |