Skip to content

Instantly share code, notes, and snippets.

View stevenhao's full-sized avatar

Steven Hao stevenhao

View GitHub Profile
@stevenhao
stevenhao / lasso_and_svm.ipynb
Last active December 13, 2017 04:54
6.867 final project code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
// bad
module.exports = __NEXT_REGISTER_PAGE("/scalers/tasks", function() {
var e = webpackJsonp([6], {
100: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
import os
import pyquaternion
import numpy
import boto3
import json
from formatter import *
DIR = 'autox_data_150_frames/autox_pilot_data_first_150_frames'
# given a 4 space-separated numbers, return the corresponding Vector4
class Vector3():
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def to_obj(self):
return {
'x': self.x,
'y': self.y,
@stevenhao
stevenhao / readme.md
Last active August 30, 2018 08:36
squarecraft.io enable right click
/*
* four wheeler, orange (255, 158, 0)
* two wheeler, red (255, 61, 99)
* pedestrian, blue (0, 0, 230)
* barrier, yellow (218, 232, 30)
* cone/other, purple (153, 0, 153)
*/
const NUSCENES_ORANGE = 'rgb(255, 158, 0)'
const NUSCENES_RED = 'rgb(255, 61, 99)'
@stevenhao
stevenhao / scraper.js
Created September 24, 2018 04:53
Messenger Stickers Scraper
// get fb sticker urls
// open the sticker view and then run this script
stickers = Array.from(document.querySelectorAll('.uiGrid._51mz._5f0n ._5r8i'))
urls = stickers.map(el => el.style.backgroundImage).map(s => s.substring(5, s.length - 2))
console.log(JSON.stringify(urls, 2, '\n'))
@stevenhao
stevenhao / prestodb-lint.js
Created November 23, 2018 06:53
presto lint
// ==UserScript==
// @name PrestoDB Linter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description modeanalytics.com userscript to autolint sql code
// @author Steven Hao
// @match https://modeanalytics.com/editor/*
// @grant none
// ==/UserScript==
@stevenhao
stevenhao / ace-exposer.js
Created November 27, 2018 11:54
Expose ace editor when its module is globally loaded
// ==UserScript==
// @name Ace Editor Exposer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://modeanalytics.com/*
// @grant none
// ==/UserScript==
@stevenhao
stevenhao / presto-parser.js
Created November 27, 2018 11:56
Browserified, antlr-generated parser
This file has been truncated, but you can view the full file.
// ==UserScript==
// @name Presto Parser
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://modeanalytics.com/editor/*
// @grant none
// ==/UserScript==
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){