Skip to content

Instantly share code, notes, and snippets.

View mattatcha's full-sized avatar

Matt Aitchison mattatcha

View GitHub Profile
var React = require('react');
var Modal = require('react-bootstrap/modal');
var Alert = require('react-bootstrap/alert');
var Button = require('react-bootstrap/button');
var ReactForms = require('react-forms');
var Schema = ReactForms.schema.Schema;
var Property = ReactForms.schema.Property;
var Form = ReactForms.Form;
var App = React.createClass({
mixins: [FluxMixin, StoreWatchMixin("AuthStore"), RoutingContextMixin],
getStateFromFlux: function() {
var flux = this.getFlux();
return {
Auth: flux.store("AuthStore").getState()
};
},
render: function() {
var gulp = require('gulp');
var path = require('path');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var util = require('gulp-util')
var less = require('gulp-less');
var clean = require('gulp-clean');
var plumber = require('gulp-plumber');
@mattatcha
mattatcha / Test
Last active August 29, 2015 14:02
➜ v8-go-test node nodetest.js
hasownproperty x 20,284,333 ops/sec ±1.61% (85 runs sampled)
undefined x 162,378,112 ops/sec ±29.83% (47 runs sampled)
Fastest is undefined
➜ v8-go-test go run main.go
test
hasownproperty x 14,973,628 ops/sec ?0.68% (67 runs sampled)
undefined x 449,704,141 ops/sec ?0.56% (69 runs sampled)
Fastest is undefined
➜ v8-go-test
// Create a token for the user after we verified their password.
// TODO: Store this in a db? This would be helpful if we would like to invalidate a login.
func (a *User) CreateToken() (string, error) {
token := jwt.New(jwt.GetSigningMethod("HS256"))
token.Claims["Id"] = a.Id
token.Claims["Email"] = a.Email
token.Claims["exp"] = time.Now().Add(time.Hour * 72).Unix()
// TODO: Move this to a config file.
var Fluxxor = require('fluxxor');
var request = require('superagent');
var AuthStore = Fluxxor.createStore({
actions: {
"LOGIN_AUTH": "onLoginAuth",
},
initialize: function() {
this.currentUser = {};
package util
import (
"crypto/rand"
"fmt"
)
type UUID [16]byte
// create a new uuid v4
set encoding=utf-8
set nocompatible " be iMproved, required
filetype off " required
set number
let mapleader = ","
set history=100
" Store a bunch of undo history
set undolevels=400
  • App
    • scripts
      • core
        • actions
        • components
        • constants
        • dispatcher
        • stores
      • pages/views
filebot -script fn:amc --output "/Volumes/DataOne/Media" --log-file amc.log --action test -non-strict "/Volumes/DataOne/CompletedOld/"