Skip to content

Instantly share code, notes, and snippets.

@aortbals
aortbals / rsync_time_machine.sh
Created March 5, 2013 18:10
Time machine backup via rsync for any unix machine.
#!/bin/bash
# Title: rsync_time_machine.sh
# Description: Time machine backup via rsync for any unix machine
# Usage:
#
# - Set the following variables:
# `HOME`: the home directory on the local machine to be backed up
# `HOST`: the SSH destination to send the backup to
# `REMOTEBACKUPDIR`: the location on the remote destination to store the backup
@aortbals
aortbals / dispatch.py
Last active October 20, 2023 16:09
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
@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 / 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 / email_test.rb
Created March 16, 2014 19:28
Rails 4 Test SMTP Settings for ActionMailer
# Sometimes it's necessary to perform a test of new SMTP settings.
# Should be run from within the rails environment.
# Tested with Rails 4.0.2
ActionMailer::Base.smtp_settings = {
address: ENV['MAILER_ADDRESS'],
domain: ENV['WEB_HOST'],
port: ENV['MAILER_PORT'],
user_name: ENV['MAILER_USER'],
password: ENV['MAILER_PASSWORD'],
@aortbals
aortbals / _media-queries.styl
Created May 20, 2014 17:19
Media Queries with Stylus
// Media Queries in Stylus
//
// Inspired by Anthony Short's _media-queries.scss to Stylus.
// https://gist.github.com/anthonyshort/2028061
//
// Usage:
//
// @media tablet-portrait-and-below
// margin: 0
// ...

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:

@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}}
@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',
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
isAdministrator: false,
notAdministrator: Ember.computed.not('isAdministrator')
});