-
use classes for everything, seriously everything
- some html elements will have a ton of classes and that’s okay—-the fewer things a single CSS class does the easier it is to understand
- in the vast majority of cases you shouldn't write your CSS rules using html tags (like
a
orli
), add a class instead so your rules aren't as tightly coupled to markup (what if you need to swap out thata
for aspan
later? hopefully you shouldn't have to change your CSS)
-
keep the specificity of your CSS rules as low as possible: a single class is the ideal
- Sass makes it really easy to nest rules, but resist the urge; think about namespacing your classes instead
It is easy and tempting to match your rule nesting to your DOM nesting:
- Sass makes it really easy to nest rules, but resist the urge; think about namespacing your classes instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"assetVersion": "1976b95f7620d99923d9", | |
"locale": "en-US", | |
"view-id-1": { | |
"name": "web-toolkit-v2/modules/buttons/react/WtButton", | |
"data": { | |
"children": "I am a button" | |
} | |
}, | |
"view-id-2": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="row"> | |
<div class="col-sm-12"> | |
<?php if (!$category_is_press): ?> | |
<?php get_sidebar(); ?> | |
<?php endif ?> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import csv | |
import os | |
rows = [] | |
input_file = sys.argv[1] | |
rows.append([ 'Date', 'Payee', 'Category', 'Memo', 'Outflow', 'Inflow' ]) | |
with open(input_file, 'rb') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $Id: avrdude.conf.in 991 2011-08-26 20:50:32Z joerg_wunsch $ -*- text -*- | |
# | |
# AVRDUDE Configuration File | |
# | |
# This file contains configuration data used by AVRDUDE which describes | |
# the programming hardware pinouts and also provides part definitions. | |
# AVRDUDE's "-C" command line option specifies the location of the | |
# configuration file. The "-c" option names the programmer configuration | |
# which must match one of the entry's "id" parameter. The "-p" option | |
# identifies which part AVRDUDE is going to be programming and must match |
I hereby claim:
- I am alliejones on github.
- I am alliejones (https://keybase.io/alliejones) on keybase.
- I have a public key whose fingerprint is 8637 1116 9D22 31D4 0498 5D18 6C7F 21C2 A919 61D9
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
var defaultTasks = ['jshint', 'concat', 'uglify']; // used for watch as well | |
var files = [ /* your source files */ ]; | |
grunt.initConfig({ | |
jshint: { | |
all: files.concat(['Gruntfile.js']) | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$my_array = array(1, 2, 3); | |
$new_array = array_map(function($num) { return $num * 2; }, $my_array); // $new_array: [2, 4, 6] | |
// Why the arguments are in the opposite order, I have no idea ... | |
$new_array2 = array_filter($my_array, function($num) { return $num % 2 == 0; }); // $new_array2: [2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Warm up: using no loops (for, while, etc.), and no global variables, write a function that returns the sum of a list: | |
* sum([1, 2, 3, 4, 5]) -> 15 | |
* sum([]) -> 0 | |
*/ | |
function sum (list) { | |
if (list.length == 0) return 0 | |
else { | |
var head = list.shift(); | |
return head + sum(list); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
li { | |
display: inline-block; | |
vertical-align: top; | |
zoom: 1; | |
*display: inline; | |
} |