Skip to content

Instantly share code, notes, and snippets.

View ashleygwilliams's full-sized avatar
>o_o<

ashley williams ashleygwilliams

>o_o<
View GitHub Profile
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
var express = require('express');
var taters = require('taters');
var enchilada = require('enchilada');
var makeup = require('makeup');
var veto = require('veto');
var browserkthx = require('browserkthx');
// we set certain settings based on production or not
var kProduction = process.env.NODE_ENV === 'production';
GOAL: use selector abstraction to reduce redundancy in our CSS.
PROMPT: Refactor this code.
HTML:
<a href="learn_more.html class="learn_more">Learn More</a>
<button href="contact.html" class="contact">Contact Us</button>
CSS:
.learn_more {
@ashleygwilliams
ashleygwilliams / html tree for julian
Created March 15, 2013 03:45
html tree for julian
<header>
<a href="index.html"><div class="logo">Julian </div></a>
<nav class="primary">
<ul></ul>
</nav>
<nav class="secondary">
<ul></ul>
</nav>
<div class="search"></div>
</header>
@ashleygwilliams
ashleygwilliams / multiple backgrounds
Last active December 14, 2015 23:39
how to style multiple background images on an element
/* assuming you have images named background1.jpg, background2.jpg in your assets/images folder
set a height so that the image can be seen using 'height'
'background-image' takes url(path/to/image.ext), url(path/to/image.ext) .. as many as you want
MDN entry: https://developer.mozilla.org/en-US/docs/CSS/background-image
'background-position' takes url(path/to/image.ext), url(path/to/image.ext) .. as many as you want
MDN entry: https://developer.mozilla.org/en-US/docs/CSS/background-position */
@ashleygwilliams
ashleygwilliams / fakeapp.rb
Last active December 16, 2015 01:39
custom sass function chooses a random(seeded) font name. want to get font name so i can include it in app head (google web font link). files as they currently are work, but pick two different fonts :( help?
class FakeApp
include Sass::Script::Functions
@@current_app = nil
attr_accessor :name, :dataset, :font
PREFIXES = ["responsive", "game", "beta", "tech", "digital", "social", "my", "our", "the", "all", "in", "on"]
SUFFIXES = ["box", "grid", "share", "wise", "hop", "works", "bit", "book", "list", "square", "rock", ".ly", "sy", "er", ".it", "ie", ".io", ".am", "ia", "ora", "ero", "ist", "ism", "ium", "ble", "ify", "ous", "ing"]
TILE_LAYERS = ["'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: 'OpenStreetMap'}",
"'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.png', {subdomains: '1234', type: 'osm', attribution: 'MapQuestOpen'}",
@ashleygwilliams
ashleygwilliams / gist:5551908
Created May 10, 2013 01:53
Here's the code from Tom's talk! If you have more questions, you should tweet @ThomasLevine
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
download = open("http://www.dol.gov/olms/regs/compliance/cba/Cba_CaCn.htm")
html = Nokogiri::HTML(download)
tables = html.search("table")
table = tables[1]
@ashleygwilliams
ashleygwilliams / gist:5667062
Last active December 17, 2015 20:19
Notes from class, 28 May 2013
Classes are blueprints. Objects are known as 'instances' of these classes.
Classes are where we define all variables and methods.
Instance variables (@var_name) and instance methods (def method_name) belong only to objects and are accessed using dot notation (Object.name) on an object made using 'Class.new'.
Class variables (var_name)
@ashleygwilliams
ashleygwilliams / bethecompiler.rb
Created May 30, 2013 23:05
go through this program and explain what the compiler does line by line. give line numbers.
# instance methods -
# def methodName
# end
# * only belong to objects
# * access them via dot notation
# * can use instance variables
#
# instance variables -
# def initialize
# @variable = value