This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, dbus | |
from time import sleep | |
from subprocess import call | |
session_bus = dbus.SessionBus() | |
spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2") | |
spotify_properties = dbus.Interface(spotify_bus, "org.freedesktop.DBus.Properties") | |
while True: | |
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Settings in here override those in "Default/Preferences.sublime-settings", and | |
// are overridden in turn by file type specific settings. | |
{ | |
"font_size": 16, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"draw_white_space": "all" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* AndroidManifest.xml | |
* | |
* <uses-permission | |
* android:name="android.permission.PACKAGE_USAGE_STATS" | |
* tools:ignore="ProtectedPermissions" /> | |
*/ | |
/** | |
* In your Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+."], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} }, | |
{ "keys": ["ctrl+;"], "command": "toggle_comment", "args": { "block": false } }, | |
{ "keys": ["ctrl+shift+;"], "command": "toggle_comment", "args": { "block": true } } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
t8.num as bit8, t7.num as bit7, t6.num as bit6, t5.num as bit5, t4.num as bit4, t3.num as bit3, t2.num as bit2, t1.num as bit1, | |
(t1.num * 1) + (t2.num * 2) + (t3.num * 4) + (t4.num * 8) + (t5.num * 16) + (t6.num * 32) + (t7.num * 64) + (t8.num * 128) as soma | |
from ( | |
((select 0 num) union all (select 1 num)) t1 | |
cross join | |
((select 0 num) union all (select 1 num)) t2 | |
cross join | |
((select 0 num) union all (select 1 num)) t3 | |
cross join |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select concat(substr(cpf, 1, 3), '.', substr(cpf, 4, 3), '.', substr(cpf, 7, 3), '-', first_dig, if(second_soma % 11 < 2, 0, 11 - (second_soma % 11))) AS cpf | |
from ( | |
select cpf, first_dig, second_one+second_two+second_three+second_four+second_five+second_six+second_seven+second_eight+second_nine+second_ten AS second_soma | |
from ( | |
select | |
cpf, | |
11*original_one AS second_one, | |
10*original_two AS second_two, | |
9*original_three AS second_three, | |
8*original_four AS second_four, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a debug keystore. When it asks for a password, enter "android" | |
# For a production keystore, change the filename (from "debug.keystore" to something else), the alias (from "androiddebugkey" to something else) and enter a different password | |
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 | |
# Jarsigner | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore YourApp.apk androiddebugkey | |
# Zipalign | |
# If you get: `zipalign: command not found`, install Android SDK Build Tools 20+. If you can't do that, add the `zipalign` dir to your path. It should be `<sdk-home>/build-tools/<android-version>/` | |
zipalign -v 4 YourApp.apk YourApp-aligned.apk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "#############################################################################################" | |
echo "This script will recursively convert the encoding of all *.java files from Mac Roman to UTF8!" | |
echo "All java files in this dir and subdirs will be changed." | |
echo "Only files with special characters will be changed. Probably." | |
echo | |
echo "Data may be lost. Use it at your own risk!" | |
echo "#############################################################################################" | |
read -p "Sure? " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[YySs]$ ]] |