Skip to content

Instantly share code, notes, and snippets.

View kidGodzilla's full-sized avatar
👋
Working from home forever

James Futhey kidGodzilla

👋
Working from home forever
View GitHub Profile
@kidGodzilla
kidGodzilla / smallchat-embed-refactored.html
Created April 24, 2017 20:34
Refactored small.chat embed
<script>
(function() {
window.Smallchat = {
config: {
"slackTeamId": "T4Z8BNW22",
"scChannelId": "-Ki28NFzPezMcBRn19Da",
"slackChannelId": "G51S6B4J3",
"uid": "-Ki28DCbmqvLWP7mK_93"
},
appearance: {

Keybase proof

I hereby claim:

  • I am kidgodzilla on github.
  • I am futhey (https://keybase.io/futhey) on keybase.
  • I have a public key whose fingerprint is E65C 7E23 BD6C 2A14 3559 AD07 A364 DD33 53CC AD03

To claim this, I am signing this object:

@kidGodzilla
kidGodzilla / simple-primes.js
Created September 15, 2016 02:54
Simple Primes
// ES5 :)
function isPrime (n) {
for (i = 2; i < n; i++)
if (n % i === 0) return false
return true
}
// ES6 (readable)
isPrime = n => { for (i = 2; i < n; i++) if (n % i === 0) return false; return true }
@kidGodzilla
kidGodzilla / raf-performance-checking.js
Created August 4, 2016 01:48
Using requestAnimationFrame() for performance checking
/**
* Performance Checking
*
* Will enable and disable a flag on the window object
* When Javascript performance suffers, so that optional features
* Can be Disabled or delayed
*/
(function () {
var lastTimestamp = + new Date();
@kidGodzilla
kidGodzilla / is-working-hours.js
Last active July 31, 2023 04:22
Is currently during working hours (Javascript)
// Example config for 9-5, M-F, PST (US)
var config = {
0: {
open: 1,
close: 0
},
1: {
open: 9,
close: 17
},
@kidGodzilla
kidGodzilla / invert-binary-tree.js
Created May 28, 2016 19:42
Invert a Binary Tree in Javascript
// This problem was inspired by this original tweet by Max Howell:
// Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.
// So, let's invert a binary tree in Javascript
// Original Tree
// 4
// / \
// 2 7
// / \ / \
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
addFriend: function () {
var friend = this.store.createRecord('friend', {
name: this.get('name'),
age: this.get('age'),
location: this.get('location')
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});