Skip to content

Instantly share code, notes, and snippets.

@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%;
@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 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 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 {
}
[
"{\"id\":1,
\"name\":\"3 Arts Entertainment\",
\"imdb_id\":\"co0070636\",
\"location_summary\":\"Beverly Hills, CA USA\",
\"types\":
[\"Distributors\",
\"Production Companies\"
]
}",
@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": [
@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 / 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>

An advanced function naming style

Everywhere possible, this is the preferred style, if you understand all the quirks to it. There aren't too many.

function foo() {

}

With this, you get function names in the fewest possible characters, there's only one caveat:

@allenwlee
allenwlee / index.html
Created May 27, 2013 23: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>