Skip to content

Instantly share code, notes, and snippets.

@mitio
mitio / rails_asset_pipeline_compiled_files.rb
Created March 7, 2012 11:14
Where the Rails' asset pipeline searches for asset files and how the config.assets.precompile directive works
# Test the result of config.assets.precompile
#
# Check which files will be regarded as "manifests" and thus precompiled and be
# available for standalone use via the /assets/<asset> URL when in production.
# Execute this code in your Rails console.
# First, you'll probably be in development mode, so add here your
# additional production precompile patterns you want to test against.
precompile = Rails.configuration.assets.precompile + [/^.+\.css$/, 'active_admin.js']
@gerhard
gerhard / Gemfile
Created April 25, 2012 11:01
guard-mocha
source 'http://rubygems.org'
gem 'guard'
gem 'guard-shell'
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@timrwood
timrwood / dirty-helpers.js
Created November 9, 2014 00:13
Ember Data Dirty Relationships Mixins
import Ember from 'ember';
export { dirtyHasMany, dirtyBelongsTo, dirtyMixin };
var dirty = 'relationshipIsDirty';
function dirtyMixin (obj) {
var args = Object.keys(obj);
var comp = Ember.computed;
args.push('isDirty');
obj[dirty] = comp.any.apply(comp, args);
@samselikoff
samselikoff / future-proof.md
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.
@jeremywrowe
jeremywrowe / .projections.json
Last active August 20, 2017 19:10 — forked from chantastic/.projections.json
ember-cli VIM projections
{
"app/adapters/*.js": {
"command": "adapter",
"template": [
"import ApplicationAdapter from './application';",
"",
"export default ApplicationAdapter.extend({",
"",
"});"
],
@migbar
migbar / ember-cli-page-object-extensions.js
Last active November 27, 2020 05:09
ember-cli-page-object extension for ember-power-select
// helpers/ember-cli-page-object-extensions.js
import { buildSelector } from '../page-object';
let selectableChoose = function(selector, options = {}) {
return {
isDescriptor: true,
value(textToSelect) {
wait().then(function() {
@jeradg
jeradg / ember-cli-mirage-object-factory.js
Last active March 3, 2016 19:47
ember-cli-mirage Ember.Object factory - Use mirage factories to mock Ember Data models in component integration tests. See also ember-data-model-mock.js: https://gist.github.com/jeradg/6f8bfbbf0722d34eea09
/*
* Decorator on a Mirage plain-ol'-JavaScript-object factory
* to allow you to create Ember objects.
*
* The objects act just enough like an Ember Data model that
* you can use them as a drop-in replacement for DS.Model instances
* in many component integration tests.
*
* Returns an object with one method, `create`, that returns
* subclasses of Ember.Object that are created with the Mirage