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
import java.io.*; | |
import java.util.concurrent.locks.ReentrantLock; | |
/** | |
* This class allows to read/write content to provided file. | |
* Class is thread-safe. | |
*/ | |
public class ContentProvider { | |
private File file; | |
private ReentrantLock lock = new ReentrantLock(); |
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
extern crate tokio_io; | |
extern crate tokio_core; | |
extern crate futures; | |
use tokio_core::reactor::Core; | |
use std::net::SocketAddr; | |
use tokio_core::net::TcpListener; | |
use tokio_core::net::TcpStream; | |
use futures::Future; | |
use futures::Stream; |
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 | |
VMOPTIONS_FILE="/Applications/Android Studio.app/Contents/bin/studio.vmoptions" | |
> "${VMOPTIONS_FILE}" | |
echo "-Xms256m" >> "${VMOPTIONS_FILE}" | |
echo "-Xmx2024m" >> "${VMOPTIONS_FILE}" | |
echo "-XX:MaxPermSize=750m" >> "${VMOPTIONS_FILE}" | |
echo "-XX:ReservedCodeCacheSize=96m" >> "${VMOPTIONS_FILE}" | |
echo "-XX:+UseCompressedOops" >> "${VMOPTIONS_FILE}" |
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 | |
COUNTER=0 | |
while [ $COUNTER -lt "$1" ]; do | |
adb shell am start -n "com.playdayteam.playday.debug/com.playday.app.ui.activity.entrance.SplashActivity" | |
sleep 3 | |
adb shell am force-stop com.playdayteam.playday.debug | |
sleep 1 | |
echo $COUNTER | |
let COUNTER=COUNTER+1 | |
done |
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
PACKAGE_NAME='com.playdayteam.playday.debug' | |
adb shell "run-as $PACKAGE_NAME chmod 777 /data/data/$PACKAGE_NAME/databases/" | |
adb shell "run-as $PACKAGE_NAME chmod 666 /data/data/$PACKAGE_NAME/databases/active_android.db" | |
adb pull /data/data/$PACKAGE_NAME/databases/active_android.db . | |
adb shell "run-as $PACKAGE_NAME chmod 700 /data/data/$PACKAGE_NAME/databases/" | |
adb shell "run-as $PACKAGE_NAME chmod 600 /data/data/$PACKAGE_NAME/databases/active_android.db" |
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
import java.util.Random; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.RecursiveTask; | |
public class ForkJoinMax { | |
private static Random random = new Random(); | |
private static final int N = 15000000; | |
private static int[] array = new int[N]; | |
private static int THRESHOLD = 100; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- | |
Place this file to /Library/LaunchAgents/ | |
In terminal run: | |
sudo launchctl load -w /Library/LaunchAgents/rtorrent.plist | |
This works with tmux http://tmux.sourceforge.net/ | |
As a frontend you can use Nativa https://www.macupdate.com/app/mac/33591/nativa | |