Skip to content

Instantly share code, notes, and snippets.

View jszmajda's full-sized avatar

Jess Szmajda jszmajda

View GitHub Profile
Room: 126 | 125
10:00 - 10:40 - Interviewing for RoR Jobs | Immutable Rails Deployments
10:40 - 11:20 - Are Boot Camps Worth It? How do I grow? | Domain Driven Design
11:20 - 12:00 - Remote Teams | Testing & strategies
12:00 - 1:40 LUNCH
@jszmajda
jszmajda / game_of_life.js
Created September 18, 2011 16:41
Game of Life in Backbone.js
var stepTime = 1;
var col = undefined;
var Cell = Backbone.Model.extend({
x: -1,
y: -1,
alive: false,
nextAlive: false,
initialize: function() {
@jszmajda
jszmajda / CoderNight.20161013.md
Last active September 29, 2016 00:18
DCRUG CoderNight 20161013

tl;dr - Coder Night is to practice development. You write code in pairs or individually and submit the code to me (joshsz @ gmail.com). I post an anonymized repo and you have a few days to look at all the solutions before a friendly night of code review.

The Problem

DNA Encoding! (see DNA.md below)

Submissions Due

Tuesday October 11th at 11:59pm.

# Multiple inheritance with Modules as an alternative to injected composition
# from Sandi Metz's talk [Nothing is Something](http://confreaks.tv/videos/bathruby2015-nothing-is-something)
# Like Sandi's 'direct' DI method this has behavior outside of the base class
# that gets composed together. However in this gist I compose modules in class
# definitions instead of injecting collaborators.
# Tradeoffs between this and Sandi's version are that in this case the API consumer doesn't
# have to know how to make a RandomEchoHouse (no `house = House.new(formatter: Whatever.new)`),
# but also the API consumer can't make anything not already accounted for either.
@jszmajda
jszmajda / binary_conversion.ex
Created April 7, 2016 14:39
Binary Conversion in Elixir
# Binary conversion: take a number 7, output "111"
defmodule Randori do
def helper(x, s \\ "")
def helper(0, "") do
"0"
end
def helper(0, s) do
s
@jszmajda
jszmajda / wordwrap.hs
Created February 4, 2016 13:53
Polyglot Programming DC Randori of WordWrap function
wordWrap :: String -> Int -> String
wordWrap xs maxLineLength = wordWrapHelper "" xs maxLineLength maxLineLength
wordWrapHelper :: String -> String -> Int -> Int -> String
wordWrapHelper result xs maxLineLength index
| length xs < maxLineLength + 1 = result ++ xs
| xs !! index == ' ' = wordWrapHelper (result ++ firstPart) lastPart maxLineLength maxLineLength
| otherwise = wordWrapHelper result xs maxLineLength (index - 1)
where
firstPart = (take index xs) ++ "\n"
@jszmajda
jszmajda / CodesOfConductAreHard.md
Last active January 26, 2016 02:55
This is a simplification of https://subfictional.com/2016/01/25/the-complex-reality-of-adopting-a-meaningful-code-of-conduct/ The goal is to share the knowledge in this article in simple, short language. If you have time, please read the original.
@jszmajda
jszmajda / gist:7815695
Created December 5, 2013 23:07
Simple rack server without http
require 'rack'
require 'rack/content_length'
require 'rack/rewindable_input'
raw = File.read('simple.ru')
app = eval("Rack::Builder.new {( #{raw} )}.to_app")
a = Rack::Builder.new do
use Rack::ContentLength
use Rack::Chunked
use Rack::CommonLogger, $stderr
@jszmajda
jszmajda / list.txt
Created July 18, 2013 17:20
"Anonymous" house email / password list. Pasted here so people on the hill can safely access it without fear of poisoned sites.
NOTE: FOR THE PURPOSES OF BEING FAR TOO GENEROUS WITH YOU GUYS, WE HAVE REMOVED SOME OF THE PASSWORDS AND SHUFFLED THE ORDER OF THE REMAINING ONES.
THESE ARE ALL CURRENT, VALID CREDENTIALS BUT THEY ARE NOT IN THE ORIGINAL PAIRINGS. WE RESERVE THE RIGHT TO SPONTANEOUSLY DECIDE THIS RESTRAINT WAS UNJUSTIFIED.
EMAIL: PASSWORD
sheena.arora@mail.house.gov:
jo@mail.house.gov:
Brianne.Nadeau@mail.house.gov: doddsquad1
deleted@mail.house.gov: Holler!8
dan.mcdonald@mail.house.gov:
rails new blog
cd blog
rails server
http://localhost:3000
rails generate controller welcome index