Skip to content

Instantly share code, notes, and snippets.

View ballPointPenguin's full-sized avatar

Bennie Rosas ballPointPenguin

View GitHub Profile
sandren /
Last active April 26, 2024 12:37
Tailwind CSS best practices

Tailwind CSS best practices

Utility classes

  1. 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!

  2. Always use fewer utility classes when possible. For example, use mx-2 instead of ml-2 mr-2 and don't be afraid to use the simpler p-4 lg:pt-8 instead of the longer, more complicated pt-4 lg:pt-8 pr-4 pb-4 pl-4.

  3. 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 of block lg:flex flex-col justify-center to make it very clear that the flexbox utilities are only applicable at the

wbotelhos /
Last active April 2, 2024 10:04
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
# 2. Clear scheduled jobs
data-enhanced / vs-code-turnoff-autocomplete.json
Last active October 3, 2020 03:18
Turn off autocompletion (intellisense) in MS Visual Studio Code
// Turn off autocomplete in Visual Studio Code
// Add the following lines to user settings
// 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",
eteeselink / delay.js
Created November 13, 2015 13:55
ES7 async/await version of setTimeout
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
2468ben / config.js
Created September 10, 2015 01:48
Active Model Sideload-only Serializer code
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
= Arch Linux step-by-step installation =
= =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
samselikoff /
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

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 of Ember.ArrayController or Ember.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.
1Marc /
Last active January 20, 2023 02:34
Workshop Planning

This gist is no longer in use.

abuiles /
Last active March 2, 2017 13:45
ember-cli + Rails build
# Based on
# for (( i = 0; i < 17; i++ )); do echo "$(tput setaf $i)This is ($i) $(tput sgr0)"; done
function printMessage {
color=$(tput setaf $1)
reset=$(tput sgr0)
echo -e "${color}${message}${reset}"
knomedia / ember_cli_rails.rake
Last active August 29, 2015 14:00
ember_cli_rails initial thoughts (see: for a more complete solution)
require 'nokogiri'
namespace :ember_cli_rails do
desc "compile ember and update application.html.erb with ENV vars"
task :build => [:ember, :update_env] do
desc 'Build ember app and copies css and js files to rails'