Skip to content

Instantly share code, notes, and snippets.

View brayancastrop's full-sized avatar

Brayan Castro brayancastrop

  • Barranquilla, Colombia
View GitHub Profile
// components/accordion-item.js
import Ember from 'ember';
export default Ember.Component.extend({
item: null,
activeItem: null,
isExpanded: Ember.computed('activeItem', 'item', function() {
return this.get('activeItem') === this.get('item');
// components/accordion-item.js
import Ember from 'ember';
export default Ember.Component.extend({
item: null,
activeItem: null,
isExpanded: Ember.computed('activeItem', 'item', function() {
return this.get('activeItem') === this.get('item');
@brayancastrop
brayancastrop / Client.js
Created January 14, 2015 21:56
Socket io rooms
var socket = io.connect();
socket.on('message', function (data) {
console.log(data);
});
socket.emit('subscribe', 'roomOne');
socket.emit('subscribe', 'roomTwo');
$('#send').click(function() {
var room = $('#room').val(),
@brayancastrop
brayancastrop / Gruntfile.js
Created December 10, 2014 02:01
haml, coffeescript and sass support
// Generated on 2014-12-09 using
// generator-webapp 0.5.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// If you want to recursively match all subfolders, use:
// 'test/spec/**/*.js'
@brayancastrop
brayancastrop / WeDidItTest.rb
Last active August 29, 2015 14:10
Given the following User Story: As a registered User, I want to send a technical request to the sys admin, So that they are aware I have a problem. Acceptance criteria * Email sent to ENV['ADMIN_EMAIL'] ----- Provide a "spec outline" which clearly shows what you will be testing, illustrated by file locations and statement hierarchy without actua…
# spec/controllers/users/issues_controller_spec.rb
describe Users::IssuesController, :type => :controller do
describe "GET new" do
it "routes to #new"
it "blocks unauthenticated access"
it "allow authenticated access and succeed"
end
Upload Files
http://pjambet.github.io/blog/direct-upload-to-s3/
@brayancastrop
brayancastrop / Libraries
Last active August 29, 2015 14:00
Amazing libraries
js
http://visjs.org/
https://github.com/brettshollenberger/ActiveSupport.js
http://matthew.wagerfield.com/flat-surface-shader/
google maps
http://mapsed.apphb.com/
ruby
https://github.com/peek/peek
/*
* This decorates Handlebars.js with the ability to load
* templates from an external source, with light caching.
*
* To render a template, pass a closure that will receive the
* template as a function parameter, eg,
* Templates.render('templateName', function(t) {
* $('#somediv').html( t() );
* });
* Source: https://github.com/wycats/handlebars.js/issues/82
@brayancastrop
brayancastrop / Observer Pattern JS
Created February 14, 2014 17:06
Observer Pattern JS
var Observer,
__bind = function(method, context){
return function(){
return method.apply(context, arguments);
};
};
Observer = (function($, window, document){
function Observer(){
$.extend(this, $({}));
@brayancastrop
brayancastrop / Website Gruntfile
Last active August 29, 2015 13:56
Gruntfile boilerplate for websites
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
meta: {
version: '1.0.0'
},
banner: '/*! Brayan Castro - v<%= meta.version %> - ' +