Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@EderRoger
EderRoger / Dockerfile
Last active December 4, 2015 15:51
Docker container - Nginx-plus
FROM ubuntu:14.04
MAINTAINER <your_email>
ENV REFRESHED_AT 2015-12-3
RUN apt-get -y update
RUN apt-get -y install wget
RUN mkdir -p /etc/ssl/nginx/
WORKDIR /etc/ssl/nginx
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@EderRoger
EderRoger / filter.js
Last active August 29, 2015 14:08
AngularJS filter with many fields
define(['angular'], function (angular) {
'use strict';
/* Filters */
angular.module('app.filters', [])
.filter('filterMultiple', ['$filter', function ($filter) {
return function (items, keyObj) {
var notFound = true;
var filterObj = {
@EderRoger
EderRoger / Conjectura.rb
Last active August 29, 2015 14:06
Ruby Conjectura de Collatz
class Conjectura
attr_reader :elements
def initialize
@elements = Hash.new
end
def calc(range)
range.each{ |i| calc_seq_cache i }
end
@EderRoger
EderRoger / callback_nested.js
Last active August 29, 2015 14:05
Angular Promise
function associaTarefaAoUsuario(){
$http({ method: 'PUT', url: context +'/bonita/humanTask/assign/' + $rootScope.idBonitasoft + '/' + $scope.tarefa.id})
.success(function (response) {
//obtem a tarefa associada e chama o form para realizar a tarefa
$http({ method: 'GET', url: context +'/bonita/humanTaskById/'+ $scope.tarefa.id})
.success(function (tarefaJsonResponse) {
$scope.tarefa = tarefaJsonResponse;
var tarefaUsuario = {
idProcessoBonitasoft : $scope.tarefa.processId.id,
idTarefaBonitasoft : $scope.tarefa.id,
@EderRoger
EderRoger / bonitaJSSocket
Last active August 29, 2015 14:03
Node.js socket.io angular-socket-io example
var socket = null;
var host;
function showAlert(){
alert('YUPI I´m Loaded');
}
function connectToSocket(){
host = window.location.hostname;
@EderRoger
EderRoger / main.js
Created July 2, 2014 17:49
RequireJS Socket.io client config
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
paths: {
angularSocketIO: '../../lib/angular-socket-io/socket',
socketio: 'http://127.0.0.1:8001/socket.io/socket.io.js'
},
shim: {
'angular': {'exports': 'angular'},
"angularSocketIO": ['angular'],
"socketio": {