Skip to content

Instantly share code, notes, and snippets.

Carlos Souza caike

Block or report user

Report or block caike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@caike
caike / routes.rb
Created Jan 31, 2014
Nice to have Route concern
View routes.rb
BananaPodcast::Application.routes.draw do
class APIEndPoint
def self.call(mapper, options)
mapper.namespace :api, path: '/', constraints: { subdomain: 'api' }
end
end
concern :api, APIEndPoint
resources :zombies, concerns: :api
@caike
caike / retrospective.md
Created Apr 22, 2014
Retrospective for the Coding Dojo @ RailsConf 2014
View retrospective.md

Coding Dojo @ RailsConf 2014

These are some of the things people had to say during our retrospective:

Things we did well

  • No one took over the code
  • Good collaboration
  • Good Communication
  • Used MiniTest for the first time
View data.sql
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
@caike
caike / emitter.js
Created Sep 26, 2014
EventEmitter in Node
View emitter.js
var EventEmitter = require('events').EventEmitter;
var util = require('util');
function Player(name, signature){
this.name = name;
this.signature = signature;
}
util.inherits(Player, EventEmitter);
View Dockerfile
# DOCKER-VERSION 1.2.0
FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Bundle app source
@caike
caike / Dockerfile
Created Sep 29, 2014
Fixed version of the Dockerfile for the tutorial at https://docs.docker.com/examples/nodejs_web_app/
View Dockerfile
# DOCKER-VERSION 1.2.0
FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Creates a new folder on the container
VOLUME /src
@caike
caike / Dockerfile
Last active Aug 29, 2015
This Dockerfile pulls application files from a URL, using the `ADD` method
View Dockerfile
# DOCKER-VERSION 1.2.0
FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/app.js /tmp/app.js
ADD https://raw.githubusercontent.com/caike/ExpressDocker/master/src/package.json /tmp/package.json
@caike
caike / angular_size.sh
Last active Aug 29, 2015
Calculating AngularJS 1.3.2 size once minified and compressed
View angular_size.sh
wget -O angular.js https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js
gzip angular.js
ls -h angular.js.gz # 45KB
@caike
caike / twit-tv-demo.rb
Created May 5, 2015
Demo code for Twit.tv
View twit-tv-demo.rb
class Person
def initialize(name, location)
@name, @location = name, location
end
def greet
"Hello my name is #{@name} and I'm from #{@location}"
end
end
You can’t perform that action at this time.