Skip to content

Instantly share code, notes, and snippets.

View alecperkins's full-sized avatar

Alec Perkins alecperkins

View GitHub Profile
#sidebar
.sidebar-item.open
.title Item 1
.info
label Some controls
input(type='checkbox')
label More controls
input(type='checkbox')
@alecperkins
alecperkins / markup.jade
Created October 16, 2012 02:31
Experiment with 3-finger-swipe-to-reveal nav
#nav
button item 1
button item 2
button item 3
#panel
h1 ☰ Hello world!
p Swipe with three fingers to the right to reveal the nav panel
@alecperkins
alecperkins / gist:3914311
Last active October 11, 2015 20:18
Sass RWD helpers
// handhelds
$break_small: 640px
// narrow-screeens
$break_medium: 980px
// full-screens
$break_large: 1400px
// wide-screens
$break_extra_large: 1600px
// extra-wide-screens
@alecperkins
alecperkins / gist:4263031
Created December 11, 2012 22:44
CoffeeScript-friendly Backbone.Marionette module definition pattern.
# Since CoffeeScript wraps everything in a closure by default, the module
# definition function pattern that Marionette normally uses is unnecessary.
# (And cumbersome with having to indent everything.) Instead, creating the
# module at the very begining makes it available to everything in the file, and
# the initializers and exported classes can be added at the end of the file.
# (This relies on things like the App and Backbone being on window, but they
# already have to be for CoffeeScript-based code to work.)
# Create the module.
Foo = App.module 'Foo'
h1 Emotional feedback to comments:
#score
textarea
| Stupid liberals always trying to free lame animals. Eat pandas.
canvas#feedback(width=720, height=300)
h2 Examples
#drop-target
@alecperkins
alecperkins / active-markdown.md
Last active December 15, 2015 01:49
Active Markdown notation

String

A read-only output of the current value of the specified variable <var_name>. The text is the default value, though it will be replaced when the HTML version loads.

[<text>]{<var_name>}
@alecperkins
alecperkins / gist:5414611
Last active December 16, 2015 09:39
Custom theme styles for Fargo (http://fargo.io). Adds some usability tweaks like hover states and a border indicating dropping a child vs a sibling. (Some of the rules are webkit specific since I primary use Chrome.) Feel free to use them, or fork and make them your own.
/* Hand cursor indicating the "wedge" is clickable. */
.node-icon {
cursor: pointer !important;
}
/* Keep the line-length of individual nodes from getting too wide. */
.concord-text {
max-width: 48em;
}
@alecperkins
alecperkins / opml_to_markdown.py
Created May 29, 2013 15:29
Convert an OPML outline to Markdown
"""
$ pip install opml
$ python opml_to_markdown.py some_outline.opml
-> some_outline.md
"""
import codecs
import opml
import sys
@alecperkins
alecperkins / actual_main.css
Last active December 18, 2015 05:29
Ideal Sass structure. Given `structure.md`, I wish the output would look like `ideal_main.css`. However, since `Block` gets imported twice and is a placeholder, not just something to extend, the rewritten selectors end up repeated. Getting around this requires `Feature/index.sass` to import `Block` instead of the ones that require it. Unfortunat…
.Image, .Text {
border: 1px solid red;
}
.Image {
border-color: green;
}
.Image, .Text {
border: 1px solid red;
}
.Text {