Skip to content

Instantly share code, notes, and snippets.

View aortbals's full-sized avatar

Aaron Ortbals aortbals

View GitHub Profile
@aortbals
aortbals / react-component-es6.sublime-snippet
Last active February 9, 2016 14:58
React JSX Sublime Text Snippets
<snippet>
<content><![CDATA[
import React, { Component } from 'react';
export default class ${TM_FILENAME/(.?\w*)(?:\.\w+)*$/$1/g} extends Component {
static propTypes = {
};
render() {
return (
@aortbals
aortbals / create_migration_and_open.sh
Last active January 3, 2016 01:59
A bash alias to create a rails migration and open it in your editor
# You should export your editor
# `export EDITOR=vim`
createMigrationAndOpen() {
rails g migration $1
ls db/migrate/* | tail -n1 | xargs $EDITOR
}
alias migration=createMigrationAndOpen
@aortbals
aortbals / jsbin.ember_array_controller_filter.html
Last active December 24, 2015 06:39
This example binds a text input to an Ember ArrayController, filtering the content as you type. http://jsbin.com/UvePomO/4/edit?html,js,output
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="ArrayController Live Filtered Content" />
<meta charset=utf-8 />
<title>ArrayController Live Filtered Content</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/release/ember.js"></script>
</head>
@aortbals
aortbals / zippable.rb
Last active September 24, 2015 02:28
Zip a directory in memory with ruby
require 'find'
require 'zip'
module Zippable
def to_zip
return zipped_file_path if File.exists? zipped_file_path
validate_file_exists
::Zip::File.open(zipped_file_path, ::Zip::File::CREATE) do |zipfile|
if File.directory? file_path
@aortbals
aortbals / controllers.application.js
Last active August 29, 2015 14:27
Array Computed Properties
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
items: [
{ name: 'Fuu' },
{ name: 'Bar' },
{ name: 'Baz' },
{ name: 'Qix' }
@aortbals
aortbals / cross-fade.js
Created July 21, 2015 21:36
`didAnimateIn` hook for Liquid Fire
import { animate, stop, Promise } from "liquid-fire";
import didAnimateIn from './helpers/did-animate-in';
/**
* Liquid Fire's cross fade animation with the `didAnimateIn` hook added.
*/
export default function crossFade(opts={}) {
stop(this.oldElement);
let promise = Promise.all([
animate(this.oldElement, {opacity: 0}, opts),
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
isAdministrator: false,
notAdministrator: Ember.computed.not('isAdministrator')
});
@aortbals
aortbals / Brocfile.js
Created October 19, 2014 13:49
ember-cll, Bourbon & Bourbon Neat
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');
var app = new EmberApp({
trees: {
styles: mergeTrees([
'bower_components/bourbon/dist',
@aortbals
aortbals / example.hbs
Last active August 29, 2015 14:07
Ember Twitter Sharing Button Component
Tweet it!
{{twitter-button data-text=twitterText data-url=twitterUrl}}

Keybase proof

I hereby claim:

  • I am aortbals on github.
  • I am aortbals (https://keybase.io/aortbals) on keybase.
  • I have a public key whose fingerprint is 6DEA C6F4 A4AC 9F4D 8FA0 3BC3 FB6E C0A1 138F 3D6A

To claim this, I am signing this object: