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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |
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 -e | |
if [ ! -f ./project.clj ]; then | |
echo "Run from a lein project directory." | |
exit 1 | |
fi | |
mkdir -p ./.fastrepl/ | |
if command -v md5 >/dev/null 2>&1; then | |
MD5=`md5 -q project.clj` |
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
/* | |
YOU'LL BE ABLE TO PERFORM A CROSS DOMAIN REQUEST IF YOUR APP IS CERTIFIED OR PRIVILEDGED. | |
FOR MORE INFO CHECK THE PERMISSIONS MATRIX: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0 | |
First you'll need to setup the permission for doing the cross domain request on your application manifest. | |
Go to your app manifest, to the permissions section and add the following: | |
"systemXHR": {} | |
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
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | |
public static String getForegroundProcess(Context context) { | |
String topPackageName = null; | |
UsageStatsManager usage = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE); | |
long time = System.currentTimeMillis(); | |
List<UsageStats> stats = usage.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 1000*1000, time); | |
if (stats != null) { | |
SortedMap<Long, UsageStats> runningTask = new TreeMap<Long,UsageStats>(); | |
for (UsageStats usageStats : stats) { | |
runningTask.put(usageStats.getLastTimeUsed(), usageStats); |