Skip to content

Instantly share code, notes, and snippets.

Avatar
🎈

Anthony Ross allcentury

🎈
View GitHub Profile
View scrabble_score.rb
require 'set'
class Scrabble
class Letter
attr_reader :point_value
def initialize(input)
@input = input
@point_value = find_value
end
View sqs.rb
class SQS
attr_reader :aws, :queue_url
def initialize(aws)
@aws = aws
@queue_url = "https://sqs.us-east-1.amazonaws.com/my-topic-for-sqs"
end
def publish_msg(msg)
aws.send_message(queue_url: queue_url, message_body: JSON.generate(msg))
end
@allcentury
allcentury / The Technical Interview Cheat Sheet.md
Last active Aug 29, 2015 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
View gist:514e32857cb7e073271d
[1] pry(main)> h = Hash.new({})
=> {}
[2] pry(main)> h[:a]
=> {}
[3] pry(main)> h["a"]
=> {}
[4] pry(main)> h
=> {}
[5] pry(main)> h = Hash.new { |k, v| k[v] = {} }
=> {}
View udp-vs-udp.rb
require 'socket'
puts "Using send with a host:"
s = UDPSocket.new
before_time = Time.now
100_000.times do |i|
s.send("#{i}", 0, 'localhost', 1234)
end
puts "Time elapsed was #{Time.now - before_time}"
puts "----------------------------\n\n\n"
View gotask.go
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"os"
"github.com/bitly/go-nsq"
"log"
)
View .vimrc
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
View .vimrc
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
View weechat-irc-gitter-im.md

Start weechat if you haven't already:

$ weechat

open up browser and go to: https://irc.gitter.im/ retrieve your /PASS

In weecaht run (thanks to raine):

View .tmux.conf
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
You can’t perform that action at this time.