Skip to content

Instantly share code, notes, and snippets.

@alonextou
alonextou / Berksfile
Created February 21, 2014 19:15
Berksfile
site :opscode
cookbook 'precise64-lamp', git: 'git@github.com:awc737/precise64-lamp-cookbook.git'

I do most of my development on a remote server or on a local virtual instance. It just makes more sense, being able to work in a portable environment and pick up where I leave off lets me worry less about environment and more about the problem at hand.

One of the problems with using a technology like VirtualBox in combination with Docker is that Docker containers are truly portable and should expose a random port chosen by the host while VirtualBox port forwarding is static. You could, for every container, create a new port forwarding rule in your VirtualBox configuration, but that requires you change host configuration to be able to run your application. Not ideal and certainly not portable.

Enter hipache. Hipache is the best way to configure reverse proxies. In this example, hipache is the entrypoint for all web traffic on the host. Running hipache in a container just like any other service allows for ultimate flexibility.

Vagrantfile

Vagrant is a cool way of abstracting VM semantics and spin

public function store($updateNulls = false){
$this->uris = implode(',', $this->uris); // implode the var
return parent::store($updateNulls);
}
public function load($pk = null, $reset = true)
{
if (parent::load($pk, $reset))
{
$this->uris = explode(',', $this->uris); // explode cboxes_var array
App.AuthController = Ember.Controller.extend({
// isGuest: true,
observeIsGuest: function() {
console.log('isGuest changed: ' + this.isGuest);
}.observes('isGuest'),
login: function() {
self.set('isGuest', false);
});
},
logout: function() {
{
"name": "app",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-watch": "~0.5.1",
"grunt-contrib-compass": "~0.3.0",
"grunt-contrib-jshint": "~0.4.1",
site :opscode
cookbook 'apt'
cookbook 'build-essential'
cookbook 'git'
cookbook 'php'
cookbook 'apache2'
cookbook 'mysql'
cookbook 'database'
cookbook 'nodejs', git: 'git@github.com:mdxp/nodejs-cookbook.git'
  1. First ordered list item
  2. Another item ⋅⋅* Unordered sub-list.
  3. Actual numbers don't matter, just that it's a number ⋅⋅1. Ordered sub-list
  4. And another item.

⋅⋅⋅You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).

⋅⋅⋅To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅

@alonextou
alonextou / alert.js
Created August 30, 2013 08:21
Ember.js Bootstrap 3 Alerts
App.AlertController = Ember.Controller.extend({
alert: false,
observeAlert: function() {
if(this.alert != false){
$('#flash').addClass('alert alert-' + this.alert[0] + ' alert-dismissable');
$('#flash span').text(this.alert[1]);
$('#flash').fadeIn();
} else {
$('#flash').hide();
}
<div id="alert">
<div id="flash">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong>Warning!</strong>
<span></span>
</div>
</div>
App.ApplicationController = Ember.Controller.extend({
hideHeader: false,
observePath: function() {
if (this.get('currentPath') !== 'index') {
this.set('hideHeader', true);
$('#header').slideUp();
} else {
this.set('hideHeader', false);
$('#header').slideDown();
}