-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2
instead ofml-2 mr-2
and don't be afraid to use the simplerp-4 lg:pt-8
instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4
. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-center
instead ofblock lg:flex flex-col justify-center
to make it very clear that the flexbox utilities are only applicable at the
This file contains 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
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
This file contains 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
// Turn off autocomplete in Visual Studio Code | |
// http://code.visualstudio.com/ | |
// Add the following lines to user settings | |
// OPTIONAL WORD WRAPPING | |
// Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns). | |
"editor.wordWrap": true, | |
// Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'. | |
"editor.wrappingIndent": "indent", |
This file contains 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
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
This file contains 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
//mirage/config.js | |
import Em from 'ember'; | |
import utils from 'ember-cli-mirage/shorthands/utils'; | |
import serializerDefs from 'crowdly-pa/tests/helpers/serializer-defs'; | |
import SerializerMachine from 'crowdly-pa/tests/helpers/serializer-machine'; | |
import { pluralize } from 'ember-inflector'; | |
export default function() { | |
this.timing = 50; // delay for each request, automatically set to 0 during testing | |
} |
This file contains 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
= Arch Linux step-by-step installation = | |
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html = | |
== Boot the installation CD == | |
== Create partition == | |
cfdisk /dev/sda | |
* Create a partition with code 8300 (Linux) |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
This gist is no longer in use.
This file contains 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
#!/bin/bash | |
# Based on https://github.com/knomedia/ember-cli-rails/blob/master/build.sh | |
# for (( i = 0; i < 17; i++ )); do echo "$(tput setaf $i)This is ($i) $(tput sgr0)"; done | |
function printMessage { | |
color=$(tput setaf $1) | |
message=$2 | |
reset=$(tput sgr0) | |
echo -e "${color}${message}${reset}" |
This file contains 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
require 'nokogiri' | |
namespace :ember_cli_rails do | |
desc "compile ember and update application.html.erb with ENV vars" | |
task :build => [:ember, :update_env] do | |
end | |
desc 'Build ember app and copies css and js files to rails' |
NewerOlder