Skip to content

Instantly share code, notes, and snippets.

View ZacSweers's full-sized avatar

Zac Sweers ZacSweers

View GitHub Profile
@ZacSweers
ZacSweers / Presentbot.py
Last active August 29, 2015 13:56
Python Bot Presentation
# http://goo.gl/sxbh65
# Presentbot.py
import praw
import pickle
import time
# log in
# reading login info from a file, it should be username \n password
with open("login.properties", "r") as loginFile:
login_info = loginFile.readlines()
@ZacSweers
ZacSweers / flashnotifierAPI.java
Created February 18, 2014 09:57
Flashnotifier API Example
// Make an API request like this:
Intent i = new Intent("com.leepapesweers.flashnotifier.API");
// Put flash pattern in request
// OPTIONAL
ArrayList pattern = new ArrayList();
pattern.add(50);
pattern.add(50);
i.putIntegerArrayListExtra("flash_pattern", pattern);
@ZacSweers
ZacSweers / sublet_posts.md
Last active August 29, 2015 13:56
Sublet Group Post Rules

UT Sublets Group Post Rules

The bot checks for 3 main things:

  • Tag validity
  • Price reference
  • Length

Note: Capitalization doesn't matter.

apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'com.demo'
version = '1.0.0'
sourceCompatibility = 1.7
repositories {
mavenCentral()
@ZacSweers
ZacSweers / HashUtil.java
Created January 31, 2015 02:02
HashUtil
/**
* Utility functions for hashing sets of values, based on the methods described in Ch. 3 of Effective Java
*/
public class HashUtil {
public static int hash(boolean... args) {
int result = 0;
for (boolean arg : args) {
result += 31 * result + (arg ? 1 : 0);
}
about
account
add
admin
api
app
apps
archive
archives
auth
@ZacSweers
ZacSweers / caltrain.geojson
Created November 6, 2015 07:57 — forked from blech/caltrain.geojson
Caltrain Ridership
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ZacSweers
ZacSweers / ArraySet.java
Created November 30, 2015 20:06
ArraySet backport
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ZacSweers
ZacSweers / dropkick.sh
Created December 26, 2015 08:28
Dropkick.sh
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
public void readTwice()
{
Observable.fromCallable(() -> {
RedditData inflatedModel = null;
Response response = makeRequest();
String diskValue = null;
try {
File file = new File(getContext().getCacheDir(), "file");
BufferedSink cacheBody = Okio.buffer(Okio.sink(file));