Skip to content

Instantly share code, notes, and snippets.

@kellishouts
kellishouts / Python-OOP-Example.py
Created January 30, 2015 01:42
Python OOP Example
// oop.py
# class definition (blueprint)
class Animal:
# class constructor method
def __init__(self, name):
# instance properties
self.name = name
self.last_ate = None
@kellishouts
kellishouts / Ruby-OOP-Example
Created January 30, 2015 01:20
ROOP: Ruby OOP Example
// oop.rb
class Animal
# properties
attr_accessor :name, :last_ate
# constructor
def initialize( name )
@name = name
puts "made an Animal named #{name}"
@kellishouts
kellishouts / review_callbacks.js
Last active August 29, 2015 14:14
Review Callbacks
//callbacks
var counter = 0;
var english = ["zero","one","two","three"];
function increase( cb ){
counter = counter + 1;
var counter_in_english = english[counter];
@kellishouts
kellishouts / closures_callbacks_scope.js
Created January 29, 2015 18:15
Closures, Callbacks, Scope
Closure
a closure is the local variables for a function - kept alive after the function has returned
a closure is a stack-frame which is not deallocated when the function returns
// scope
function outer_scope() {
@kellishouts
kellishouts / code_is_not_math.md
Last active August 29, 2015 14:13
Code is Not Math

Code is not Math

Equality is Weird

  • = does not mean “equals” it means “set a value”
  • == means “equal”
  • === also means “equal”

Programmers start counting at 0

  • var potatoes = [0, 1, 2, 3, 4, 5]

Starting up a project with /app/public for final output files AND using Foundation


In your project root

Copy over relevant assets into a ./Layouts directory.

Make this file to ignore installable components.
.gitignore

@kellishouts
kellishouts / gist:de8864d4a3da256c3a1f
Created December 4, 2014 07:02
Flappy App Overriding Foundation's top-bar
// Requires a custom media query $medium-down
// Uses the following markup:
// <nav class="top-bar" data-topbar role="navigation">
// <ul class="title-area">
// <li class="name">
// <a href="#" class="clearfix">
// <div class="logo_image"></div>
// <h1>
// <span id="flappy">Flappy</span>
@kellishouts
kellishouts / gist:d88ee410c489a92a751f
Created December 4, 2014 05:40
Flappy App Inline Media Queries
// Your markup may be different. The following styles only apply for this markup snippet:
// <header id="page_header">
// <div class="row">
// <div class="large-6 medium-3 small-12 columns">
// <div class="title">
// <h1>
// <span class="flappy">flappy</span>
// <span class="app">app</span>
// </h1>
@import "http://fonts.googleapis.com/css?family=Lato:400,700.css";
@import "partials/settings";
@import "../public/bower_components/foundation/scss/foundation.scss";
$break-small: 480px;
$break-medium:768px;
$flappy-dark-grey:#2B2D33;
$flappy-blue:#00CCCC;
body{
background-color:$flappy-dark-grey;
// d. Media Query Ranges
// - - - - - - - - - - - - - - - - - - - - - - - - -
$small-range: (0em, 40em);
$medium-range: (40.063em, 64em);
$large-range: (64.063em, 90em);
$xlarge-range: (90.063em, 120em);
$xxlarge-range: (120.063em, 99999999em);
$screen: "only screen";