Skip to content

Instantly share code, notes, and snippets.

View hugosenari's full-sized avatar
🌞

Hugo Sena Ribeiro hugosenari

🌞
View GitHub Profile
@hugosenari
hugosenari / n9XX_dbus_net_client.md
Created May 11, 2012 08:53
draft idea: write a dbus client for maemo/meego (n900/n9)
@hugosenari
hugosenari / pattern1.md
Last active October 6, 2015 03:28
draft idea: project config pattern

Draft idea

Before begin a project make one base project config or use base that exist

Suggestion use linux common dirs names (bin, etc, ...) like other projects do.

Define vcs for your project

Configs:

@hugosenari
hugosenari / check_changes.py
Created July 4, 2012 23:01
python to run command when something changes in directory
#THANKS TO: http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html
#time for pooling in seconds
TIME = 2
#path to watch this version don't recursive
PATH = "."
#command to execute when something changes
COMMAND = "dir"
import os, time
@hugosenari
hugosenari / content.md
Created July 18, 2012 19:51
Checklist para recebimento de wirefram/psd

Coisas que eu sempre tenho que verificar quando recebo um wire frame/psd:

Básico:

  • Trata todos os casos de sucesso e erro?
  • É viável e aceitável?
  • Trata todas as telas?

Opcional:

  • Isto vai ficar leve?
  • Isto é usável?
@hugosenari
hugosenari / README.md
Last active October 7, 2015 18:48
Bash util for git

Bash Script to use with git

With this your console print:

USER_NAME@MACHINE_NAME DIR_NAME (BRANCH_NAME:STATUS)$
```c 

Where status are:
M when current repo has modified
@hugosenari
hugosenari / .gitconfig
Created August 14, 2012 19:03
Configure Git To use with wimerge (wine)
[merge]
tool = winmerge
[mergetool "winmerge"]
cmd = /home/hugosenari/.bin/winmerge.sh \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\"
trustExitCode = false
keepBackup = false
[mergetool]
prompt = false
@hugosenari
hugosenari / makefile
Created September 12, 2012 14:55
make
CSS = Content/css/style.css
CSS_MIN = Content/css/style.min.css
CSS_META = Content/css/meta-css/style.less
LESS = 'Content/css/meta-css/.*\.less'
JSS = $(wildcard Scripts/*.js)
JSS_NAMES = $(basename ${JSS})
DATE=$(shell date +%I:%M%p)
@hugosenari
hugosenari / teste.md
Last active October 12, 2015 01:07
teste automatizado orientado a logs

Parse Logs

Create applications where logs are parsed by other applications that test and check if is working fine

Good For:

  • Automated Tests;
  • Health check.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# [SNIPPET_NAME: Systray icon]
# [SNIPPET_CATEGORIES: PyGTK]
# [SNIPPET_DESCRIPTION: Shows a system tray icon with a menu ]
# [SNIPPET_AUTHOR: João Pinto <joao.pinto@getdeb.net>]
# [SNIPPET_LICENSE: GPL]
#
# adapted from: http://eurion.net/python-snippets/snippet/Systray%20icon.html
@hugosenari
hugosenari / gist:4323219
Created December 17, 2012 22:58
Time is on my side
var times = $$('li').map(function(e){
time = e.innerHTML.split(" ")[1].split(":");
return [time[0], time[1], time[2], 0];
})
horas = (times[1][0] - times[0][0]) + (times[3][0] - times[2][0])
minutos = (times[1][1] - times[0][1]) + (times[3][1] - times[2][1])
htom = horas * 60
sum = minutos + htom;
console.log(parseInt(sum / 60), sum % 60)