Skip to content

Instantly share code, notes, and snippets.

View wrburgess's full-sized avatar
:shipit:
Shippin'

Randy Burgess wrburgess

:shipit:
Shippin'
View GitHub Profile
@wrburgess
wrburgess / # Sublime Emmet JSX Reactjs.md
Created October 20, 2015 02:35 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
  • Using className instead of class

How it works

  • Install plugin RegReplace
  • Install plugin Chain Of Command
@wrburgess
wrburgess / new_gist_file.md
Created April 25, 2015 00:47
Upgrading heroku databases
heroku addons:add heroku-postgresql:standard-0 --remote staging
heroku maintenance:on --remote staging
heroku ps:scale worker=0 --remote staging
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK --remote staging
heroku pg:promote HEROKU_POSTGRESQL_PINK --remote staging
heroku ps:scale worker=1 --remote staging
heroku maintenance:off --remote staging
@wrburgess
wrburgess / teachermate_dev_calendar.md
Last active August 29, 2015 14:17
TeacherMate Dev Calendar

Teacher Notepad Leads: Matt, Randy
Practice Station Leads: Angeleah, John
Partner Station Leads: John, Randy

Mar 16 - Mar 20 Teacher Notepad Begins  
Mar 23 - Mar 27 TutorMate Reporting Stable
Mar 30 - Apr 03  
Apr 06 - Apr 10  
Apr 13 - Apr 17 Practice Station Begins 
class ApiController < ApplicationController
# define which model will act as token authenticatable
acts_as_token_authentication_handler_for Login
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
respond_to :json
skip_before_filter :verify_authenticity_token, if: :json_request?
@wrburgess
wrburgess / internet_speed_test_system.md
Last active August 29, 2015 14:16
Internet Speed Test System

Situation

  1. We have laptops distributed across 200+ classrooms in various locales in the USA
  2. Some of these classrooms have volatile Internet speeds that descrease greatly during the middle of the day (10am - 2pm)
  3. The majority of laptops have Windows 7 installed on them. A few have Windows 8.

Goal

  1. We would like to record, on an hourly or half-hour basis, the Internet speeds of these classrooms so data trends can be presented to the IT admins at the schools.
//var csv is the CSV file with headers
function csvJSON(csv){
var lines=csv.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
//var tsv is the TSV file with headers
function tsvJSON(tsv){
var lines=tsv.split("\n");
var result = [];
var headers=lines[0].split("\t");
for(var i=1;i<lines.length;i++){
@wrburgess
wrburgess / livechat_webhook.md
Created February 9, 2015 15:49
example payload

resource

POST https://www.tutormate.org/chat_transcripts

payload

{
# db/migrate/20131118172653_create_transactional_items_view.rb
class CreateTransactionalItemsView < ActiveRecord::Migration
def up
select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read }
# for materialized view:
view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})"
# for normal view:
view_sql = "CREATE VIEW transactional_items AS (#{select_sql})"