Skip to content

Instantly share code, notes, and snippets.

View marceloslacerda's full-sized avatar

Marcelo Lacerda marceloslacerda

View GitHub Profile
@marceloslacerda
marceloslacerda / pfimage_viewer.py
Created March 3, 2014 12:38
cProfile friendly image viewer
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
import os, sys
print 'Printing absolute path for "."'
print os.path.abspath('.')
print 'Printing get_script_home() output:'
main = sys.modules['__main__']
# if hasattr(main, '__file__'):
print os.path.dirname(os.path.abspath(main.__file__))
print main
@marceloslacerda
marceloslacerda / CMakeOutput.log
Created March 29, 2011 21:24
Log generated by the current HEAD of FrozenCow's Monocle-Engine fork
The system is: Linux - 2.6.32-30-generic - i686
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/gcc
Build flags:
Id flags:
The output was:
0
@marceloslacerda
marceloslacerda / output.log
Created March 29, 2011 22:09
The output from the ./cmake-build.sh
$ ./cmake-build.sh
Do you want to build tests? (y/n) :
y
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
@marceloslacerda
marceloslacerda / output.log
Created March 30, 2011 20:11
Another output from the cmake on my college computer
$ ./cmake-build.sh
Do you want to build tests? (y/n) :
y
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
@marceloslacerda
marceloslacerda / cd_ipy.py
Last active December 22, 2015 14:49
ipython extension to handle an absent pwd
"""Once this extension is installed to a ipython instance, it no longer crashes if the current directory is removed.
Based on the work of dhananjaysathe
More info at: https://github.com/ipython/ipython/pull/811"""
import os, logging, IPython, errno
def getcwdu(self):
"""Graciously handles cases when PWD does not exist.
Defaults to home directory eliminating the OSError exception.
"""
try:
@marceloslacerda
marceloslacerda / .emacs.el
Created September 12, 2013 13:45
my emacs config
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auto-save-file-name-transforms (quote ((".*" "temporary-file-directory" t))))
'(backup-directory-alist nil)
'(blink-cursor-mode nil)
'(browse-url-browser-function (quote browse-url-firefox))
'(bubbles-game-theme (quote easy))
# cat /etc/systemd/system/hubot.service
[Unit]
Description=Hubot
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/root/hubot_hal/
User=root
$ xinput --list "Wacom Intuos S 2 Pen stylus"
Wacom Intuos S 2 Pen stylus id=11 [slave pointer (2)]
Reporting 8 classes:
Class originated from: 11. Type: XIButtonClass
Buttons supported: 7
Button labels: None None None None None None None
Button state:
Class originated from: 11. Type: XIKeyClass
Keycodes supported: 248
Class originated from: 11. Type: XIValuatorClass
$ xsetwacom -v --list dev
... Display is '(null)'.
... 'list' requested.
... Found device 'Virtual core XTEST pointer' (4).
... 'Virtual core XTEST pointer' (4) is not a wacom device.
... Found device 'Virtual core XTEST keyboard' (5).
... 'Virtual core XTEST keyboard' (5) is not a wacom device.
... Found device 'Power Button' (6).
... 'Power Button' (6) is not a wacom device.
... Found device 'Video Bus' (7).