Skip to content

Instantly share code, notes, and snippets.

Hi Zach :D

Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.

First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@kaeff
kaeff / .bowerrc
Last active December 15, 2015 22:50
How to use Bower with the Asset Pipeline in Rails
{
"directory" : "vendor/assets/components"
}
@tcannonfodder
tcannonfodder / testem.json
Last active December 10, 2015 18:08
This is a bare-minimum testem configuration file that will allow you to use testem with a rails project. You save it in the root directory of the project (at the same level as the Gemfile), and then you can navigate to the project and run testem. How it works: What this configuration does is precompile the assets before the tests are run using t…
{
"framework": "jasmine",
"src_files": [
"app/assets/javascripts/*.js",
"spec/scripts/*.js"
],
"serve_files": [
"public/assets/*.js",
"spec/scripts/*.js"
],
@bensmithett
bensmithett / gist:4030944
Last active September 12, 2020 12:44
Convert an image sequence to a 1080p video
brew install ffmpeg
ffmpeg -start_number 079 -y -r 30 -i "DSC_0%03d.JPG" -vf scale=1920:-1,crop=1920:1080 -vcodec libx264 -b:v 10000k -r 30 outputhd.m4v
# Optional bits
# -start_number: the first number in the sequence (default: 0)
# -y: overwrite output files without asking
# -r: input framerate (i.e. photos per second. The second -r is the output framerate)
# -i: input files. %03d = 3 digits (so this example would use DSC_0079.JPG - DSC_0999.JPG)
# Picked 10000k for the bitrate based on https://support.google.com/youtube/answer/1722171?hl=en
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@matthieua
matthieua / gist:1311614
Created October 25, 2011 06:46
CoffeeScript Presentation Examples - Envato - 25/10/2011
# ::::::::: :::::::::: ::: ::: ::::::::
# :+: :+: :+: :+:+: :+:+: :+: :+:
# +:+ +:+ +:+ +:+ +:+:+ +:+ +:+ +:+
# +#+ +:+ +#++:++# +#+ +:+ +#+ +#+ +:+
# +#+ +#+ +#+ +#+ +#+ +#+ +#+
# #+# #+# #+# #+# #+# #+# #+#
# ######### ########## ### ### ########
# ::::::::::: ::::::::::: ::: ::: ::::::::::
# :+: :+: :+:+: :+:+: :+:
# +:+ +:+ +:+ +:+:+ +:+ +:+
@ryanflorence
ryanflorence / cs-iife.coffee
Created September 29, 2011 19:10
CoffeeScript Immediately Invoked Function Expressions
increment = do ->
x = 0
->
x++