Skip to content

Instantly share code, notes, and snippets.

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();
}
App.ApplicationController = Ember.Controller.extend({
observePath: function() {
if (this.get('currentPath') !== 'index') {
$(window).scrollTop(264)
} else {
$(window).scrollTop(0)
}
}.observes('currentPath')
});
App.AuthController = Ember.Controller.extend({
user: null,
isAdmin: false,
isGuest: true,
actions: {
login: function() {
console.log('logging in');
var self = this;
var response = $.Deferred();
$.ajax({