View gist:5074217
This file contains 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
private void restartThis() { | |
finish(); | |
overridePendingTransition(0, 0); | |
startActivity(getIntent()); | |
overridePendingTransition(0, 0); | |
} |
View write.py
This file contains 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
with open('abc.txt', mode) as f: | |
f.write('abc') |
View read.py
This file contains 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
with open('abc.txt', mode) as f: | |
print(f.read()) |
View tell.py
This file contains 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
with open('abc.txt', mode) as f: | |
print(f.tell()) |
View open.py
This file contains 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
open('abc.txt', mode) |
View env.bat
This file contains 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
@REM Qt5 + MinGW でコンパイルできる環境を作るバッチ | |
@REM === ENV === | |
SET MINGWBIN=c:\mingw64\bin | |
SET PERLBIN=C:\strawberry\perl\bin | |
SET PYTHONBIN=c:\python27 | |
SET RUBYBIN=C:\Ruby200-x64\bin | |
SET GITBIN=C:\mingw64\msys\bin | |
SET QTREPO=C:\Qt\qt5 |
View qt5build.bat
This file contains 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
@REM MinGW64 で Qt5 をコンパイルするためのバッチ | |
@REM 参考) MinGW 64 bit | Qt Wiki | Qt Project http://qt-project.org/wiki/MinGW-64-bit | |
@REM | |
@REM [使い方] | |
@REM あらかじめ、OpenSSL, ICU をビルドし、インストールしておく事 | |
@REM 以下の環境変数の値を === ENV === の欄で適切に設定する | |
@REM MINGWBIN MinGW の bin ディレクトリ (コンパイラがあるディレクトリ) | |
@REM PERLBIN perl.exe があるディレクトリ | |
@REM PYTHONBIN python.exe があるディレクトリ | |
@REM RUBYBIN ruby.exe があるディレクトリ |
View gist:7288407
This file contains 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
#!/bin/bash | |
# | |
# Brightness script for the ASUS G74SX | |
# | |
# Arguments: | |
# up - increase brightness by 1 | |
# down - decrease brightness by 1 | |
# | |
BRIGHTNESS=`cat /sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness` |
View gist:5599293
This file contains 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
# Hide mouse cursor | |
widget.setCursor(Qt.BlankCursor) | |
# Show mouse cursor (parent's cursor is used) | |
widget.unsetCursor() |
View gist:5074821
This file contains 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
PreferenceManager | |
.getDefaultSharedPreferences(ctx) | |
.edit() | |
.clear() | |
.commit(); | |
PreferenceManager.setDefaultValues(ctx, R.xml.preferences, true); |