Skip to content

Instantly share code, notes, and snippets.

View roblight's full-sized avatar

Rob Light roblight

View GitHub Profile
@roblight
roblight / streamtest.js
Created September 23, 2019 14:16 — forked from dirkvm/streamtest.js
websocket based streaming for Tesla
const util = require('util');
const WebSocket = require('ws');
const vehicle_id = ''; // as returned by the /vehicles api call
const token = ''; // tokens[0] as returned by the /vehicles api call
const email = ''; // login e-mail
const stream_columns = [
'speed',
'odometer',
@roblight
roblight / sequelize-schema-file-generator.js
Created February 2, 2018 19:43 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@roblight
roblight / sequelize-migration-file-generator.js
Created February 2, 2018 19:43 — forked from manuelbieh/sequelize-migration-file-generator.js
Creates migration files for existing sequelize models
import * as models from "models";
import fs from "fs";
for(let model in models) {
let attributes = models[model].attributes;
for(let column in attributes) {
delete attributes[column].Model;
delete attributes[column].fieldName;
const { DataTypes } = require('sequelize')
module.exports = {
schema: {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
autoIncrement: true,
},
@roblight
roblight / java-signals-test.sh
Created January 26, 2016 12:28 — forked from nicoulaj/java-signals-test.sh
What signals can your JRE handle ?
#!/bin/bash
# Get temp dir
tmpdir=$(mktemp -d)
# Generate test
cat > ${tmpdir}/ListenToSignal.java <<EOF
import sun.misc.Signal;
import sun.misc.SignalHandler;
public class ListenToSignal {
@roblight
roblight / index.ts
Last active September 17, 2015 15:53 — forked from davideast/index.ts
Simple Angular 2 Forms with Firebase
import {bootstrap, Component, Decorator, View, If, For, EventEmitter} from 'angular2/angular2';
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
@Component({
selector: 'app',
injectables: [FormBuilder]
})
@View({
template: `
<div class="container" [control-group]="myForm">
@roblight
roblight / choice-quotes.md
Created September 17, 2015 11:44
Choice Quotes
browser_adapter.js:82EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]
browser_adapter.js:73EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]BrowserDomAdapter.logError @ browser_adapter.js:73BrowserDomAdapter.logGroup @ browser_adapter.js:83ExceptionHandler.call @ exception_handler.js:67(anonymous function) @ application_common.js:259NgZone._onError @ ng_zone.js:241NgZone._createInnerZone.errorHandling.onError @ ng_zone.js:151run @ angular2.dev.2.0.0-alpha.35.js:139NgZone._createInnerZone.zone.fork.fork.$run @ ng_zone.js:165zoneBoundFn @ angular2.dev.2.0.0-alpha.35.js:109lib$es6$promise$$internal$$tryCatch @ angular2.dev.2.0.0-alpha.35.js:1359lib$es6$promise$$internal$$invokeCallback @ angular2.dev.2.0.0-alpha.35.js:1371lib$es6$promise$$internal$$publish @ angular2.dev.2.0.0-alpha.35.js:1342(anonymous function) @ angular2.dev.2.0.0-alpha.35.js:187NgZone._createInnerZone.zone.fork.fork.$scheduleMicrotask.microtask @ ng_zone.js:199run @ angular2.dev.2.0.0-alpha.35.j
#!/bin/sh
### Run this script via a cronjob every (every minute or so) on a server that has access to your dropbox.
### You must install youtube-dl (http://rg3.github.com/youtube-dl/) for this to work.
queue_files_dir=~/Dropbox/IFTTT/youtube-dl
queue_files="$queue_files_dir"/*.txt
output_dir=/Volumes/Internal\ HD/Files/Videos/YouTube
shopt -s nullglob
@roblight
roblight / scrapple.py
Last active August 29, 2015 14:06 — forked from jhofman/scrapple.py
#!/usr/bin/env python
#
# file: scrapple.py
#
# description: checks apple.come for iphone 5s in-store pickup availability
#
# usage: ./scrapple.py [zip] [att|verizon|sprint] [16|32|64] [grey|silver|gold]
#
# or in a crontab:
# */5 * * * * /path/to/scrapple.py 10012 verizon 32 grey && mailx -s 5s [email protected]