Skip to content

Instantly share code, notes, and snippets.

View kennyt's full-sized avatar

Kenny Tran kennyt

  • San Francisco, CA
View GitHub Profile
This file has been truncated, but you can view the full file.
html:not(.style-scope) {
--primary-text-color: var(--light-theme-text-color);
--primary-background-color: var(--light-theme-background-color);
--secondary-text-color: var(--light-theme-secondary-color);
--disabled-text-color: var(--light-theme-disabled-color);
--divider-color: var(--light-theme-divider-color);
--error-color: #dd2c00;
--primary-color: #3f51b5;
--light-primary-color: #c5cae9;
--dark-primary-color: #303f9f;

Keybase proof

I hereby claim:

  • I am kennyt on github.
  • I am kennyt (https://keybase.io/kennyt) on keybase.
  • I have a public key ASDVkNVpeOzefP9JVg2v-AD6i3w8ySgv_kpghXe9jFBZdgo

To claim this, I am signing this object:

var getAllPermutations = function(str){
if(str.length < 2){
return [str];
}
var result = [];
for(var i = 1; i < str.length + 1; i++){
var beginning = [str.slice(0, i)];
var rest = getAllPermutations(str.slice(i));
<!DOCTYPE html>
<html>
<head>
<title>woopra</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
</head>
<body>
@kennyt
kennyt / sweeper.rb
Created January 16, 2013 06:08
review!
class Game
require 'colorize'
require 'json'
require 'yaml'
def initialize
@placed_mines = 0
@correct_flags = 0
@flags = 0
class Word
# this could be changed to attr_reader since you only use it to read the value
attr_accessor :word, :parent_word_obj
def initialize(word, parent_word_obj)
@word = word
@parent_word_obj = parent_word_obj
end
end
##
##
##
# Inside the Hangman class :
# move the attr_accessors to the beginning of the method
# also, why have attr_accessors when you introduce each of the instance variables with def initialize?
attr_accessor :secret_word, :dictionary_words, :player_string, :word_size_floor, :word_size_ceiling,
##
## I stringed together all the parts of code I commented on.
## In general, space your code more!
def my_sort
self.size.times do |variable|
self.each_with_index do |element, index|
unless self[index+1].nil?
result = yield(element, self[index+1]) # adding a default i.e. proc.nil? {|x,y| x<=>y} instead of yield would make it more sort-like
if result==1 || result == true # I don't understand. Isn't everything other than nil true? Therefore result == 1 adds nothing.
@kennyt
kennyt / w1d2_review.rb
Created January 9, 2013 06:26
w1d2 review
## General Comments
## You guys didn't comment enough early on in the day, I felt kind of lost on some methods.
## Later on you guys turned on beast mode though, nice commenting.
##
##
##Below I took out pieces of code on which I commented on, instead of uploading all files
@kennyt
kennyt / gist:3963816
Created October 27, 2012 09:47
event_manager
require "csv"
require "sunlight"
class EventManager
INVALD_ZIPCODE = '00000'
INVALID_PHONENUMBER = '0000000000'
Sunlight::Base.api_key = "e179a6973728c4dd3fb1204283aaccb5"
def initialize (filename)
puts "EventManager initialized."