Skip to content

Instantly share code, notes, and snippets.

@lifeinafolder
lifeinafolder / components.instamojo-payment.js
Created April 29, 2017 17:15
Instamojo Emberjs Component
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
Ember.$.getScript('https://d2xwmjc4uy2hr5.cloudfront.net/im-embed/im-embed.min.js');
},
didRender() {
console.log(Ember.$('.im-checkout a'));
}
const pages = [
{
image: "URL", // a 1x1 grid image
cells: [
{
x: 0,
y: 0,
width: 100%
}
]
@lifeinafolder
lifeinafolder / radio-button-group.js
Last active December 23, 2015 20:09
Ember wrapper for radio button group
UiControls = window.UiControls || Ember.Namespace.create();
/**
* An Ember RadioButton Group Control
*
* @example
* {{#view UiControls.RadioButtonGroup group="segment-option" valueBinding="sendingPreference"}}
* {{view UiControls.RadioButton title="Title 1" value="1"}}
* {{view UiControls.RadioButton title="Title 2" value="2"}}
* {{/view}}
@lifeinafolder
lifeinafolder / chosen-multi-select.js
Created September 24, 2013 16:19
An Ember wrapper for chosen multi-select
//= require chosen-jquery
UiControls = window.UiControls || Ember.Namespace.create();
/**
* Custom Multi-Select enabled with 'chosen'
* @class
* @memberOf UiControls
* @extends Ember.Select
*
@lifeinafolder
lifeinafolder / onoff-switch.js
Created September 24, 2013 16:17
An ember wrapper for the bootstrap-switch module.
//= require bootstrap-switch
UiControls = window.UiControls || Ember.Namespace.create();
/**
* Custom iPhone style ON-OFF switch control
*
* @class
* @memberOf UiControls
* @extends Ember.View
@lifeinafolder
lifeinafolder / input-max-length.js
Created September 17, 2013 05:35
Ember Input Fields with character limits
UiControls = window.UiControls || Ember.Namespace.create();
/**
* A MaxLength UI Control
* It extends your regular INPUT[type='text'] & TEXTAREA fields
* to support a character count on them
*
* @class
* @memberOf UiControls
* @extends Ember.View
@lifeinafolder
lifeinafolder / Ember Redactor Wrapper
Created December 5, 2012 13:10
Ember-Redactor.js
RedactorView = Ember.View.extend({
templateName: 'redactor',
didInsertElement: function () {
require('editor/vendor/redactor/redactor');
// If 'css' is not injected yet, inject it.
if (!Utils.hasCss('css/redactor.css')) {
$('head').append('<link rel="stylesheet" href="css/redactor.css" type="text/css" />');
}
@lifeinafolder
lifeinafolder / minispade.txt
Created October 3, 2012 18:23
Minispade Options
# @option options [Boolean] :string If true, compiles the output as
# a String instead of a closure. This means that @sourceURL can be
# appended for good stack traces and debugging.
@lifeinafolder
lifeinafolder / output.txt
Created June 16, 2012 10:41
Javelin Build Script Output
+ set -e
++ dirname scripts/build.sh
+ ROOT=scripts/../
+ cd scripts/../externals/libfbjs
+ make
g++ -fPIC -Wall -DNOT_FBMAKE=1 -ggdb -g -O0 -DDEBUG -c -o parser.yacc.o parser.yacc.cpp
g++ -fPIC -Wall -DNOT_FBMAKE=1 -ggdb -g -O0 -DDEBUG -c -o node.o node.cpp
/usr/include/c++/4.2.1/ext/ropeimpl.h: In static member function ‘static typename __gnu_cxx::rope<_CharT, _Alloc>::_RopeLeaf* __gnu_cxx::rope<_CharT, _Alloc>::_S_leaf_concat_char_iter(__gnu_cxx::_Rope_RopeLeaf<_CharT, _Alloc>*, const _CharT*, size_t) [with _CharT = char, _Alloc = std::allocator<char>]’:
/usr/include/c++/4.2.1/ext/ropeimpl.h:675: instantiated from ‘static typename __gnu_cxx::rope<_CharT, _Alloc>::_RopeRep* __gnu_cxx::rope<_CharT, _Alloc>::_S_concat(__gnu_cxx::_Rope_RopeRep<_CharT, _Alloc>*, __gnu_cxx::_Rope_RopeRep<_CharT, _Alloc>*) [with _CharT = char, _Alloc = std::allocator<char>]’
/usr/include/c++/4.2.1/ext/rope:2763: instantiated from ‘__gnu_cxx::rope<_CharT, _Alloc> __gnu_cxx::operator+(const __gnu_cxx::rope<_CharT, _Alloc>&,
var fn = function() {
var dfd = new Deferred();
var promises = [];
promises.push(async1()); // an async operation
promises.push(async2()); // an async operation
promises.push(sync1()); // a sync operation
promises.push(async3()); // an async operation
// You want to perform some computation after above 4 tasks are done.