Skip to content

Instantly share code, notes, and snippets.

View maluta's full-sized avatar

Tiago Maluta maluta

View GitHub Profile
for info in listDirectory("c:\Users\\rafael\Music\Músicas\ ", [".mp3"]):
print ("\n".join(["%s=%s" % (k, v) for k, v in info.items()]))
print
Ministério das Relações Exteriores - Escritório de Representação em São Paulo (ERESP)
Setor de Legalização de Documentos
Avenida das Nações Unidas, 11857, 4° andar
CEP 04578-908 São Paulo – SP
Setor de Legalizações e Rede Consular Estrangeira– SLRC
Ministério das Relações Exteriores – MRE
Esplanada dos Ministérios – Bloco H, Anexo I, Térreo
CEP: 70170-900, Brasília – DF
@maluta
maluta / main.py
Last active August 29, 2015 14:01
Kivy example
## Kivy contact and support:
# http://kivy.org/docs/contact.html
# Kivy on irc.freenode.net
#
## Kivy android build doc:
# http://kivy.org/docs/guide/packaging-android.html
#
## Python-for-android:
# https://github.com/kivy/python-for-android
# http://python-for-android.readthedocs.org/en/latest/
---
# python 3
>>> print(42)
42
# python 2
>>> print 42
42
{
"extensionName": "ScratcherControl",
"extensionPort": 50007,
"blockSpecs": [
["r", "Voice Command", "voice-command"],
["r", "Accelerometer X", "accelerometer-x"],
["r", "Accelerometer Y", "accelerometer-y"],
["r", "Accelerometer Z", "accelerometer-z"],
["r", "Brightness", "light-level"],
["b", "Start Button Pressed?", "start-button-pressed"],
/* Extension using Worldcup data */
/* JSON data http://worldcup.sfg.io */
/* by Tiago Maluta (@maluta) <tiago.maluta@gmail.com>, Jun 2014 */
new (function() {
var ext = this;
ext._shutdown = function() {};
ext._getStatus = function() {
# maybe you saw the student making something like
type = 5
len = 4
#restore
from __builtin__ import type
from __builtin__ import len
type(5)
# <type 'int'>
#/usr/bin/python
'''
My best score in 'Swing Copters' was using this code... :/
https://play.google.com/store/apps/details?id=com.dotgears.swing&hl=en
** Tested only on LG Nexus 4 **
To run just copy this file and run on terminal
# monkeyrunner swing_copters.py
import subprocess
import sys
import os
arg = sys.argv[1]
cmd = ("adb shell ls \"" + arg + "\"")
# creating dir
folder = arg.split("/")[::-1][1]
print("Creating dir: ./" + folder)
os.mkdir(folder)