Skip to content

Instantly share code, notes, and snippets.

View lvegerano's full-sized avatar

Luis Vegerano lvegerano

View GitHub Profile
@lvegerano
lvegerano / sqlAsync
Created February 9, 2015 04:41
Sample with async and sequelize where the "catch all" .catch() still get an unhandled exception.
async.series([
function(callback) {
sequelize
.authenticate()
.then(function() {
callback();
})
.catch(function authException(err) {
//console.log(err);
callback(err);
var connect = require('connect'),
path = require('path'),
routes = require('./routes'),
exphs = require('express3-handlebars'),
moment = require('moment');
module.exports = function (app) {
app.engine('handlebars', exphs.create({
defaultLayout: 'main',
layoutsDir: app.get('views') + '/layouts',
var App = Ember.Application.create();
App.IndexRoute = Ember.Route.extend({
model: function() {
return {
name: 'one',
className: 'dropdown',
choices: [
{ choice: 'Choose One' },
{ choice: 'First' },
// Modules
const EventsEmitter = require('events');
// Libs
const _ = require('lodash');
const Winston = require('winston');
const Pluralize = require('pluralize');
const Promise = require('bluebird');
const bookshelf = require('./pg');
import Ember from 'ember';
import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor';
export default FroalaEditorComponent.extend({
options: {
heightMin: 200
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
showImage: false,
actions: {
toggle: function () {
this.toggleProperty('showImage');
}
}
<SortableJs
class="list-group"
@items={{array "one" "two" "three" "four" "five"}}
@options={{hash animation=150 ghostClass="ghost-class" group="shared"}}
@onRemove={{this.onRemove}}
@onEnd={{this.onEnd}}
as |list|
>
{{log 'running a' list}}
{{#each list as |item index| }}
@lvegerano
lvegerano / clone.hbs
Created March 11, 2020 18:15
Ember SortableJS examples
<SortableJs
class="list-group"
@items={{array "one-a" "two-a" "three-a" "four-a" "five-a"}}
@options={{hash
animation=150
ghostClass="ghost-class"
group=(hash name="shared" pull="clone")
}}
@onClone={{fn this.onClone}}
as |list|
@lvegerano
lvegerano / clone.hbs
Created March 11, 2020 18:15
Ember SortableJS examples
<SortableJs
class="list-group"
@items={{array "one-a" "two-a" "three-a" "four-a" "five-a"}}
@options={{hash
animation=150
ghostClass="ghost-class"
group=(hash name="shared" pull="clone")
}}
@onClone={{fn this.onClone}}
as |list|
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked list = [
{