Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Horner ahornerr

View GitHub Profile
View Southern Miss Layout code.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/md_white_1000"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
View banner_card_action.json
{
"enabled": true,
"message": "This is a banner with an asset/card action",
"data": [
{
"assetId": "79996014"
}
]
}
View posttorrent.sh
#!/bin/bash
LOG_FILE=/var/lib/transmission-daemon/posttorrent.log
# Username for transmission remote.
TR_USERNAME="transmission"
# Password for transmission remote.
TR_PASSWORD=""
# Get current time.
NOW=$(date +%Y-%m-%d\ %H:%M:%S)
DEST_DIR="/media/raid/Processed Torrents/"
View banner
{
"front": "Gamecast",
"eventid": 123456,
"message": "The Reds are taking on the Nationals now. Follow the game LIVE."
}
@ahornerr
ahornerr / Gradle
Last active Aug 29, 2015
Android Robotium Test
View Gradle
Executing tasks: [:Dolly-App:assembleKentucky_wildcatsDebug, :Dolly-App:assembleKentucky_wildcatsDebugAndroidTest]
View Easter Egg.java
private void doMySearch(String query) {
if (query.equalsIgnoreCase("sttubkcid") || query.equalsIgnoreCase("ttubkcid")) {
toggleLoadingIndicator();
}
}
public static void toggleLoadingIndicator() {
boolean currentValue = getSharedPrefs().getBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), false);
SharedPreferences.Editor editor = getSharedPrefs().edit();
editor.putBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), !currentValue);
View psoJSON.js
{
"algorithm": "particleSwarm",
"fitnessFunction": "sphere",
"parameters": {
"dimension": 3,
"isMaxObj": true,
"numRuns": 100,
"iterations": 100,
"numParticles": 100,
"minPosition": -5.12,
View promises.js
function deployPromise(profile) {
var shasum = crypto.createHash('sha1');
shasum.update(config.secretSalt + profile.ampacheID);
ampacheMysqlPassword = shasum.digest('hex');
return mysqlHelper.setupAmpacheSQL(profile, ampacheMysqlPassword).then(function() {
configHelper.writeAmpacheConfig(profile, ampacheMysqlPassword);
configHelper.writeNginxConfig(profile).then(function() {
sh.run("sudo service nginx reload");
});
return createInstance(profile);
View shit.js
var columns = [
{id: 1234567890, title: "shittily named title"},
{id: 0987654321, title: "shitty title 2"}
];
var mapping_table = {
mapped_column1_name: "shitty title 2",
mapped_column2_name: "shittily named title"}
};
View test.js
var markers = MarkerService.getAllMarkers();
$scope.map.markers = _.reduce(filters, function(previousVal, filter) {
return filter.filterFunc(previousVal);
}, markers);
console.log('Went from ' + markers.length + ' to ' + $scope.map.markers.length);
var sampleFilter = {
name : "Order Completion",
id : "completion",