Skip to content

Instantly share code, notes, and snippets.

@allenwlee
allenwlee / index.html
Created May 29, 2013 07:21 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@allenwlee
allenwlee / rails.md
Last active December 18, 2015 00:59
rails notes

##Notes

Type Sinatra Rails Notes
Partials <%= erb :_menu %> <%= render "menu" %> the underscore is implied, such that this will render the file named _menu.html.erb
Partial from another directory <%= erb :_menu %> <%= render "shared/menu" %> ---
Partial layouts --- <%= render :partial => "link_area", :layout => "graybar" %> Note that explicitly specifying :partial is required when passing additional options such as :layout. Layouts also follow the leading underscore convention, e.g., _graybar.html.erb
Pass local variables via partials, part 1 --- <%= render :partial => "form", :locals => { :zone => @zone } %>
Pass local variables via partials, part 2 --- <%= render :partial => "customer", :object => @new_customer %> Every partial has a local variable with the same name as the partial (minus the underscore). You can pass an object in to this local variable via the :object option.
Shorthand --- `<%= render @customer %>
@allenwlee
allenwlee / test.json
Created August 20, 2013 20:10
test json format
[
{
"id": 2,
"name": "Brillstein Entertainment Partners",
"imdb_id": "co0214340",
"created_at": "2013-08-07T23:14:03.190Z",
"updated_at": "2013-08-07T23:14:03.193Z",
"country_short": null,
"country_long": null,
"types": [
[
"{\"id\":1,
\"name\":\"3 Arts Entertainment\",
\"imdb_id\":\"co0070636\",
\"location_summary\":\"Beverly Hills, CA USA\",
\"types\":
[\"Distributors\",
\"Production Companies\"
]
}",
@allenwlee
allenwlee / dabblet.css
Created January 5, 2014 06:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background-color: #fff;
}
.container {
}
@allenwlee
allenwlee / dabblet.css
Created January 5, 2014 06:39
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background-color: #fff;
}
.logo {
color: #000;
font-family: Quicksand;
font-size: 36px;
@allenwlee
allenwlee / dabblet.css
Created January 12, 2014 22:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background-color: #fff;
}
.logo {
color: #000;
font-family: Quicksand;
font-size: 36px;
@allenwlee
allenwlee / dabblet.css
Created February 1, 2014 03:34
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;

GitHub Archive leaderboard challenge

GitHub Archive provides stats for projects on GitHub via a RESTful HTTP service.

Create a command-line program that lists the most active repositories for a given time range. It should support the following interface:

  gh_repo_stats [--after DATETIME] [--before DATETIME] [--event EVENT_NAME] [-n COUNT]
@allenwlee
allenwlee / dabblet.css
Created May 2, 2014 16:39
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.outer {
position: relative;
height: 100px;
width: 100px;
background-color: black;
}