Skip to content

Instantly share code, notes, and snippets.

View pedroxs's full-sized avatar

Joaquim Pedro Silveira pedroxs

View GitHub Profile
@pedroxs
pedroxs / jQuery-ajaxStop
Last active December 22, 2015 11:39
jQuery trigger event - ajaxStop
$.event.trigger('ajaxStop')
/*
* helper function for fast typing on
* http://10fastfingers.com/
*
* 200 ms seems good enough
*/
function Gambi(interval) {
var timerId, start, stop, getId, currentWord;
start = function() {
{
init: function(elevators, floors) {
//current #challenge=7
var idleElevators = _.range(elevators.length);
elevators.forEach(function(elevator, index) {
elevator.index = index;
elevator.on("idle", updateIdleQueue);
elevator.on("floor_button_pressed", traverse);
elevator.on("goto_floor", traverse);
@pedroxs
pedroxs / bower.json
Created April 22, 2015 00:39
Frontend dependency management with auto import
{
"name": "myApp",
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-rc.2"
},
"dependencies": {
"ngCordova": "~0.1.14-alpha",
"restangular": "~1.5.1"
},
@pedroxs
pedroxs / Address.scala
Created May 4, 2015 21:08
Validate cassandra schema with model object
package model
import java.util.UUID
import play.api.libs.json.Json
case class Address(
id: Option[UUID],
address: Option[String],
number: Option[Int],
@pedroxs
pedroxs / env.log
Created July 10, 2015 21:59
docker-machine env log
shell: .
executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo swarm-master --machinereadable
STDOUT: name="swarm-master"
groups="/"
ostype="Linux 2.6 / 3.x (64 bit)"
UUID="bbf5592e-0ca1-461f-b995-be57e3387624"
CfgFile="C:\\Users\\Pedro\\.docker\\machine\\machines\\swarm-master\\swarm-master\\swarm-master.vbox"
SnapFldr="C:\\Users\\Pedro\\.docker\\machine\\machines\\swarm-master\\swarm-master\\Snapshots"
LogFldr="C:\\Users\\Pedro\\.docker\\machine\\machines\\swarm-master\\swarm-master\\Logs"
hardwareuuid="bbf5592e-0ca1-461f-b995-be57e3387624"
@pedroxs
pedroxs / docker-machine-create.log
Last active August 29, 2015 14:25
docker-machine error logs
executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
STDOUT: Oracle VM VirtualBox Command Line Management Interface Version 4.3.20
(C) 2005-2014 Oracle Corporation
All rights reserved.
Usage:
VBoxManage [<general option>] <command>
@pedroxs
pedroxs / docker_firefox_and_chrome.sh
Created August 31, 2015 15:40
Run Firefox or Google Chrome from a docker container.
docker build -t chrome - << __EOF__
#FROM java:8-jre
#FROM tifayuki/java:8
FROM ubuntu:14.04
RUN adduser --disabled-password --gecos '' chrome \
&& adduser chrome sudo \
&& adduser chrome video \
&& adduser chrome audio \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN apt-get update -qqy \
@pedroxs
pedroxs / EitherTest.scala
Last active March 11, 2016 00:24 — forked from iamthiago/EitherTest.scala
Showing some functional code in Scala
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, Future}
/**
* Created by thiago on 3/10/16.
*/
object EitherTest extends App {
//given a list of ids
@pedroxs
pedroxs / application.yml
Created July 20, 2016 07:44
Spring Boot application properties to check JPA annotations agaisnt created DB model.
---
# Test DB profile
spring:
profiles: db
jpa:
database: MYSQL
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
generate-ddl: true
hibernate:
ddl-auto: create-drop