- Use classes for everything as much as possible (no ID selectors, no tag selectors)
- Use a special prefix for classes to attach page-specific interaction JavaScript, e.g.
.js-affiliates-table
- Use
* { box-sizing: border-box; }
as the rule, not the exception - Widgets are always preferable over page-specific styles
- Widgets can be broken down into 1.) framework widgets (buttons/wells/tables) - these are re-usable across projects and 2.) app-specific widgets (dependencies not filled widget, notification widget, etc.) - these are project specific
- Pay attention to typography using simple guidelines
- Pick a base line height
- Size all line heights as multiples of the base line height when possible
- Attempt to establish vertical rhythm of all block element heights
- Use the line-height as the correct multiple for vertical margin above and below elements
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
define([ | |
'bluebird', | |
'bootbox' | |
], function( | |
Bluebird, | |
bootbox | |
) { | |
'use strict'; | |
return { |
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 | |
$needles = array( | |
'/fizz/buzz' | |
); | |
$haystack = '/var/tmp/fizz/buzz'; | |
$fileMatched = array_reduce( | |
$needles, | |
function($carry, $needle) use ($haystack) { |
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
$ docker run -it --rm phusion/passenger-full /sbin/my_init -- bash -l | |
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh... | |
No SSH host key available. Generating one... | |
Creating SSH2 RSA key; this may take some time ... | |
Creating SSH2 DSA key; this may take some time ... | |
Creating SSH2 ECDSA key; this may take some time ... | |
Creating SSH2 ED25519 key; this may take some time ... | |
invoke-rc.d: policy-rc.d denied execution of restart. | |
*** Running /etc/rc.local... | |
*** Booting runit daemon... |
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
define([ | |
'chaplin' | |
], function( | |
Chaplin | |
) { | |
'use strict'; | |
return Chaplin.View.extend({ | |
bind : function(callback) |
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
var guarantorFetchedPromise = $.Deferred(); | |
var collateralFetchedPromise = $.Deferred(); | |
this.guarantorCollection.fetch({ | |
success: guarantorFetchedPromise.resolve, | |
error: guarantorFetchedPromise.reject | |
}) | |
this.collateralCollection.fetch({ | |
success: collateralFetchedPromise.resolve, | |
error: collateralFetchedPromise.reject |
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
this.listenTo(this.model, 'change', this._onModelChange); | |
initialize: function() | |
{ | |
// Only save every second at most | |
this._save = _.debounce(this._save, 1000); | |
}, | |
_onModelChange: function() | |
{ |
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
// List each selector on its own line | |
.foo-bar, | |
.widget-baz { | |
// List these 4 attributes in a section at the top | |
// List them in this order | |
position: absolute; | |
left: 10px; | |
top: 10px; | |
// Store z-index in a central location | |
z-index: $foo-bar-z-index; |
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
// NPC by cmwelsh | |
//#CLIENTSIDE | |
this.onPlayerChats = function () { | |
if (this.player.chat === 'warp') { | |
this.player.x = 30; | |
this.player.y = 35; | |
} | |
} |
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
/* Left will inherit from right (so we don't need to duplicate code */ | |
.github-fork-ribbon { | |
/* The right and left lasses determine the side we attach our banner to */ | |
position: absolute; | |
/* Add a bit of padding to give some substance outside the "stitching" */ | |
padding: 2px 0; | |
/* Set the base colour */ | |
background-color: #9b0024; |
NewerOlder