Skip to content

Instantly share code, notes, and snippets.

View kencrocken's full-sized avatar

Ken Crocken kencrocken

View GitHub Profile
@kencrocken
kencrocken / state_counties_dist.js
Last active January 11, 2018 15:53
array of state objects containing name, abbreviation, fips, counties and congressional districts. Index equals the state fips
[
null,
null,
null,
null,
null,
null,
null,
null,
null,
@kencrocken
kencrocken / auth.service.ts
Created August 6, 2017 04:51 — forked from codediodeio/auth.service.ts
Angular4 Firebase authentication service using OAuth, Anonymous, and Email/Password. Designed specifically for changes introduced in AngularFire2 4.0.0
import { Injectable } from '@angular/core';
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Router } from "@angular/router";
import * as firebase from 'firebase';
@Injectable()
export class AuthService {
<!DOCTYPE html>
<svg width="960" height="600"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/topojson.v2.min.js"></script>
<script>
var svg = d3.select("svg");
d3.json("https://d3js.org/us-10m.v1.json", function(error, us) {
if (error) throw error;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kencrocken
kencrocken / gulp.js
Created May 3, 2016 08:04 — forked from Fishrock123/gulp.js
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
function fizzBuzz(num) {
return (num % 3 * num % 5 == 0) ? (num % 3 == 0 ? "fizz" : "") + (num % 5 == 0 ? "buzz" : "") : num;
}
for(i = 1; i < 101; i++){
var y = fizzBuzz(i);
$("#result").append('<p>'+y+'</p>');
}
import requests
response = requests.get('http://api.wmata.com/StationPrediction.svc/json/GetPrediction/B06,E06?api_key=kfgpmgvfgacx98de9q3xazww')
assert response.status_code == 200
data = response.json()
for prediction in data['Trains']:
print 'Line:{} | Destination: {} | Time: {} Minutes'.format(prediction['Line'], prediction['DestinationName'], prediction['Min'])
class Skills
def development_skills
{
programming_languages: %w(Ruby PHP),
frameworks: %w(Rails Sinatra),
testing: %w(RSpec FactoryGirl Cucumber),
front_end: %w(Javascript AngularJS SCSS),
content_management: %(WordPress)
version_control: %w(Git)
}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.bar {
fill: black;
}
.bar:hover{
fill: firebrick;
# check if 'num' is divisble by either 3 or 5. If true, check if divisible by 3 -
# print 'fizz' or if false ''. Same with 5, but print 'buzz'. Came up with the idea when fiddling around
# and had "num%3 * num%5 == 0 ? 'fizz' + 'buzz' : num". I believe it works just like concatenating a string
# Essentially, I believe that is what is going on, this is merely concatenating strings whichis why the '+'
# works to connect the two conditions; i.e., really connecting two strings.
def fizzbuzz(num)
num % 3 * num % 5 == 0 ? ( num % 3 == 0 ? "fizz" : "" ) + ( num % 5 == 0 ? "buzz" : "" ) : num
# num % 3 == 0 && num % 5 == 0 ? "fizzbuzz" : num % 3 == 0 ? "fizz" : num % 5 == 0 ? "buzz" : num
end