Skip to content

Instantly share code, notes, and snippets.

View rtfpessoa's full-sized avatar

Rodrigo Fernandes rtfpessoa

View GitHub Profile
@rtfpessoa
rtfpessoa / .gitconfig
Last active December 31, 2015 00:39
git Configuration
#
# rtfpessoa git Configuration
#
# core {{{
[core]
editor = /usr/bin/nano
pager=less -x4
quotepath = false
# excludesfile = /Users/rtfpessoa/.gitignore
@rtfpessoa
rtfpessoa / typed-actors-routing.scala
Created February 19, 2014 23:01
Typed Akka Actors Routing
val defaultAkkaTimeout = 60
val defaultNumberOfActors = 10
def getComponentActor[T <: AnyRef](timeout: akka.util.Timeout = Timeout(Duration(defaultAkkaTimeout, SECONDS)))(implicit m: Manifest[T]): T = {
val className = this.classCache.get(m.runtimeClass.getName)
val actorCount = defaultNumberOfActors
val actors = createRouterActors(actorCount,className,timeout)
val router = system.actorOf(Props.empty.withRouter(SmallestMailboxRouter.create(actors.toIterable.asJava)))
TypedActor(system).typedActorOf(TypedProps(Reflect(system).actorClassFor(className.get)).withTimeout(timeout), router)
@rtfpessoa
rtfpessoa / .tmux.conf
Last active August 29, 2015 13:59
Tmux Configuration
# cat << ►_◄ > /dev/null
#
# Tmux config
#
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# colors please
@rtfpessoa
rtfpessoa / SimpleGestureController.java
Created April 30, 2014 12:42
Android Gesture Handler
package pt.utl.ist.cmov.bomberman.controllers;
import pt.utl.ist.cmov.bomberman.controllers.interfaces.SimpleGestureListener;
import android.app.Activity;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
public class SimpleGestureController extends SimpleOnGestureListener {
@rtfpessoa
rtfpessoa / android-studio-cleaner.sh
Created June 1, 2014 20:16
Script to Clean Android Studio on MacOS
#!/bin/sh
#
# MacOS Android Studio Cleaner
#
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
@rtfpessoa
rtfpessoa / java-8-ami.md
Last active March 21, 2022 14:46
[Guide] Install Oracle Java (JDK) 8 on Amazon EC2 Ami
@rtfpessoa
rtfpessoa / revoke-delete.sh
Created October 11, 2014 18:07
Revoke delete directory permissions
#
# Simple script to revoke delete permissions
#
DIRECTORY=$1
if [ "$DIRECTORY" != "" ]; then
chmod 0700 $1
chmod +a "group:everyone deny delete" $1
echo "Delete permissions revoked with success!"
@rtfpessoa
rtfpessoa / oracle-jdk-remove.sh
Created October 25, 2014 22:18
Oracle JDK Removal Mac OSx
#!/bin/bash
#
# Oracle JDK Removal Mac OSx
#
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
@rtfpessoa
rtfpessoa / singleton.js
Created February 13, 2015 22:15
Simple Javascript singleton example
/*
* Simple Javascript singleton example
*/
var Printer = function () {
// Object stateless code here
var counter = 0;
//counter is useless here
this.print("[" + counter++ + "] String to print!");
@rtfpessoa
rtfpessoa / idea.vmoptions
Last active April 25, 2017 08:27
IntelliJIDEA 14 VM Options
-ea
-server
-Xms512m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:MaxMetaspaceSize=512m
-XX:ReservedCodeCacheSize=256m
-XX:CMSIncrementalDutyCycleMin=0
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC