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
| def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b) |
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
| final Handler handler = new Handler(); | |
| Runnable run = new Runnable() { | |
| @Override | |
| public void run() { | |
| // insert code to be run every 1000 milliseconds | |
| handler.postDelayed(this, 1000); | |
| } | |
| }; | |
| handler.post(run); |
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
| new CountDownTimer(10000, 1000) { | |
| @Override | |
| public void onTick(final long inL) { | |
| // countdown is counting down every 1000 milliseconds = 1sec | |
| } | |
| @Override | |
| public void onFinish() { |
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
| #!/bin/sh | |
| echo $'\n'$1 >> requirements.txt; pip install $1 |
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
| #!/bin/env bash | |
| # source http://zeroturnaround.com/rebellabs/making-gradle-builds-faster/ | |
| echo 'org.gradle.configureondemand=true' >> ~/.gradle/gradle.properties | |
| echo 'org.gradle.daemon=true' >> ~/.gradle/gradle.properties | |
| echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties |
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
| sudo chown -R $(whoami) /usr/local |
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
| How to Completely Remove Android Studio | |
| Execute these commands from the terminal | |
| rm -Rf /Applications/Android\ Studio.app | |
| rm -Rf ~/Library/Preferences/AndroidStudio* | |
| rm ~/Library/Preferences/com.google.android.studio.plist | |
| rm -Rf ~/Library/Application\ Support/AndroidStudio* | |
| rm -Rf ~/Library/Logs/AndroidStudio* |
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
| # 'Item*' it the pattern to look for | |
| # sed "s/I/i/g" is the replacement pattern | |
| for f in Item*; mv $f (echo {$f} | sed "s/I/i/g"); end |
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
| rem net start > services.txt | |
| for /F "tokens=*" %%A in (services.txt) do ( | |
| ECHO Stopping service %%A.... | |
| net stop "%%A" | |
| ) |
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
| set "exes=Dropbox chrome evernote OfficeClicktoRun googledrivesync" | |
| for %%e in (%exes%) do ( | |
| echo Killing process %%e... | |
| taskkill /im %%e.exe /f | |
| ) |