Skip to content

Instantly share code, notes, and snippets.

View hugosenari's full-sized avatar
🌞

Hugo Sena Ribeiro hugosenari

🌞
View GitHub Profile
@hugosenari
hugosenari / sheep-say
Created June 12, 2013 02:19
cowsay -f sodomized-sheep "Eu sou uma ovelha sendo encoxada"
< Eu sou uma ovelha sendo encoxada >
----------------------------------
\ __
\ (oo)
\ ( )
\ /--\
__ / \ \
UooU\.'@@@@@@`.\ )
\__/(@@@@@@@@@@) /
(@@@@@@@@)((
@hugosenari
hugosenari / test.py
Created July 1, 2013 21:35
Test to watch objects (need more tests)
from functools import wraps
def WatchedMethod(method, watcher, cls):
'''Called as 'self.method(*args, **kwds)' '''
@wraps(method)
def method_wrapper(*args, **kwds):
name = method.__qualname__
try:
watcher(cls, Watcher.CALL, name, *args, **kwds)
value = method(*args, **kwds)
@hugosenari
hugosenari / .travis.yml
Last active December 21, 2015 15:59 — forked from KelSolaar/.travis.yml
language: python
python:
- "2.6"
- "2.7"
before_install:
- cd ..
- curl -OL http://sourceforge.net/projects/pyqt/files/sip/sip-4.14.6/sip-4.14.6.tar.gz
- tar -xvf sip-4.14.6.tar.gz
- cd sip-4.14.6
- python configure.py
@hugosenari
hugosenari / POG.cs
Last active December 22, 2015 11:29
Attaching OASIS Username Tokens headers in WCF Requests + WCF Extensibility – Behavior configuration extensions .net
using System;
using System.Configuration;
using System.Security.Cryptography;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Xml;
@hugosenari
hugosenari / sudolike.md
Last active December 25, 2015 00:19
Linux Driver/Command that require root/sudo auth before deny access

This Idea:

Linux Driver or Command that require root or sudo before deny access.

Objective:

Create better user experience where they can try open/write anything and where is not possible try authentication/authorization before deny.

@hugosenari
hugosenari / string_format_converter.md
Created December 5, 2013 11:50
Command or Web App that convert string formats from one language to another

This Idea:

Command or Web App that convert string formats from one language to another

Objective:

Make easy translate one print from one language to other.

@hugosenari
hugosenari / pre_commit_review_curses_gui.md
Created February 18, 2014 03:39
Git pre-commit review curses gui

This Idea:

Create a Git pre-commit review curses gui.

Objective:

Easily choose files and review changes before commit

@hugosenari
hugosenari / .gitconfig-alias
Last active January 11, 2019 17:14
git + jira(atlassian) + stash(atlassian)
# 'BNAME' = current branch name
# 'BDESC' = current branch description
# return the name of current branch
bname = rev-parse --abbrev-ref HEAD
# get/set description for current branch
bdesc = "!f() { BNAME=`git bname`; if [ $# -gt "0" ]; then BNAME=$1; fi; if [ $# -lt "2" ]; then git config branches.$BNAME.description; else git config branches.$BNAME.description \"$2\"; fi; }; f"
# create new branch with $1 as BNAME and $2 as BDESC, push to vp
@hugosenari
hugosenari / port-3128.log
Last active August 29, 2015 14:25
Error with Archiva when network proxy is necessary (ref https://github.com/apache/archiva/pull/16)
2015-07-16 16:33:42,444 [taskScheduler#indexDownloadRemote-1] INFO org.apache.archiva.scheduler.indexing.DownloadRemoteIndexTask [] - start download remote index for remote repository ibiblio
2015-07-16 16:33:42,446 [taskScheduler#indexDownloadRemote-1] DEBUG org.apache.archiva.proxy.common.DefaultWagonFactory [] - http headers set to: {User-Agent=Java-Archiva}
2015-07-16 16:33:42,447 [taskScheduler#indexDownloadRemote-1] INFO org.apache.archiva.scheduler.indexing.DownloadRemoteIndexTask [] - index update retrieve file, name:nexus-maven-repository-index.properties
2015-07-16 16:33:42,447 [taskScheduler#indexDownloadRemote-1] DEBUG org.apache.archiva.proxy.common.DebugTransferListener [] - transferInitiated for resource nexus-maven-repository-index.properties on repository url http://mirrors.ibiblio.org/maven2/.index/
2015-07-16 16:33:42,548 [taskScheduler#indexDownloadRemote-1] DEBUG org.apache.archiva.proxy.common.DebugTransferListener [] - wagon debug http://mirrors.ibiblio.org/maven2/.index/nexus-maven-r
#!/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