Skip to content

Instantly share code, notes, and snippets.

View marcoslopes's full-sized avatar

Marcos Antonio Lopes marcoslopes

  • Brisbane, Australia
  • 15:13 (UTC +10:00)
View GitHub Profile
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EsId {
}
@marcoslopes
marcoslopes / Mac::Pomodoro
Last active August 29, 2015 14:24
Mac::Pomodoro
#!/bin/sh
#
####################################
# Pomodoro
####################################
showHelp () {
echo "-------------------------------";
echo "Pomodoro Command Line Interface";
echo "-------------------------------";
@marcoslopes
marcoslopes / chat.py
Created October 25, 2015 07:02 — forked from lbolla/chat.py
import sys
import tornado.ioloop
import psycopg2
import psycopg2.extensions
io_loop = tornado.ioloop.IOLoop.instance()
conn = psycopg2.connect('dbname=mytest user=lbolla password=secret')
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
@marcoslopes
marcoslopes / portforwarding.md
Created November 2, 2015 00:48 — forked from kujohn/portforwarding.md
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@marcoslopes
marcoslopes / submodule-pull.sh
Created April 29, 2016 10:37 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@marcoslopes
marcoslopes / iterm2.zsh
Created September 15, 2016 01:14 — forked from wadey/iterm2.zsh
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
@marcoslopes
marcoslopes / Between Battles
Created July 27, 2017 13:10 — forked from kilbot/Between Battles
product.json
{
"product": {
"title": "Between Battles",
"id": 27540,
"created_at": "2015-06-12T00:59:52Z",
"updated_at": "2015-06-12T01:08:11Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
@marcoslopes
marcoslopes / Between Battles
Created July 27, 2017 13:10 — forked from kilbot/Between Battles
product.json
{
"product": {
"title": "Between Battles",
"id": 27540,
"created_at": "2015-06-12T00:59:52Z",
"updated_at": "2015-06-12T01:08:11Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.