Skip to content

Instantly share code, notes, and snippets.

@jshawl
jshawl / docker-compose.yml
Last active December 2, 2018 16:13
Simplest possible Wordpress + MySql + phpMyAdmin docker-compose.yml
version: '3.3'
services:
db:
container_name: db
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@eliotsykes
eliotsykes / rails_new_help_output.md
Last active March 31, 2024 17:09
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@bradymholt
bradymholt / google_calendar_api_example.rb
Last active February 25, 2017 05:57
Google Calendar API with Ruby Client
#gem install 'google-api-client'
require 'google/api_client'
#Setup auth client
client_secrets = Google::APIClient::ClientSecrets.load #client_secrets.json must be present in current directory!
auth_client = client_secrets.to_authorization
auth_client.update!(
:scope => 'https://www.googleapis.com/auth/calendar',
:access_type => "offline", #will make refresh_token available
@RobertAKARobin
RobertAKARobin / warmupw01d02.md
Last active August 29, 2015 14:17
Warmup, W01D02

Mission: Impossible!

We, the Impossible Missions Force, have become aware that Doctor Nefarious is planning on using his Nefarious Computer (a standard Macbook) to initiate a nuclear launch sequence that will destroy the entire world.

Our sources have told us that the nuclear launch sequence is run from a shell script, and have also given us a tree showing the contents of the Doctor's computer (the flash drive has been added to show where in the structure it will appear):

NO_NUCLEAR_LAUNCH_SEQUENCES_HERE/
	nopeNotALaunchSequence.sh
TOP_SECRET/
	SERIOUSLY_TOP_SECRET/
@RobertAKARobin
RobertAKARobin / w01d01homework.md
Last active August 29, 2015 14:17
w01d01 Homus Workus

Homework, W01D01


Create a function in your .bash_profile that will set up a working directory for a new GA student!

Things it should do:

  • Create a folder called GeneralAssembly
@adambray
adambray / example_lesson.md
Created February 28, 2015 20:23
Example Lesson Plan - Scaffolding

Domain Modeling and Databases

Learning Objectives

  • Describe the basic parts of an ERD
  • Construct ERDs to model the nouns and relationships in a domain
  • Explain what a database is and why you would use one as opposed to other persistent storage mechanisms
  • Explain the difference between a database management system (R/DBMS) and a database, and name the major DBMSes
@JackVCurtis
JackVCurtis / SHA1
Created February 20, 2015 18:08
Single block implementation of SHA1 in Ruby. DO NOT USE THIS IN REAL LIFE.
def rot_left(num, count)
bin_string = num.to_s(2)
bin_string = ("0" * (32 - bin_string.length)) + bin_string
shifted_string = bin_string[0..(count-1)]
rotated_string = bin_string[count..31] + shifted_string
return rotated_string.to_i(2)
end
def lsb_32(num)
s = num.to_s(2)
class JobSchedule
# External interface for calling the service
def self.call(object_id, opts={})
if perform_asynchronously?
Delayed::Job.enqueue(EnqueuedJob.new(name, object_id, opts))
else
perform(object_id, opts)
end
end
@adambray
adambray / ga_lesson_plan_template.md
Created January 28, 2015 22:36
Lesson Plan Template Markdown

Delivery Tips:

  • Think about how long you're talking
  • Move quicker sooner, slower later
  • Cold Call more often
  • Revisit LOs
  • Defer questions when appropriate

LESSON TITLE

@adambray
adambray / programming_cockatils.md
Created November 13, 2014 20:25
Programming Cocktails

Programming Cocktails

The Best Ideas (All have been served 'in production')

  • Prototype - An Old Fashioned
  • Gem and Tonic - Gin & Tonic + Grenadine
  • Solarized Light - A Tequila Sunrise, name is a play on a terminal theme.
  • Ruby red - red wine with coke (aka Kalimotxo)
  • Bourbon.css - Bourbon on the rocks