Skip to content

Instantly share code, notes, and snippets.

Avatar

Zac Sweers ZacSweers

View GitHub Profile
@ZacSweers
ZacSweers / Presentbot.py
Last active Aug 29, 2015
Python Bot Presentation
View Presentbot.py
# 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 Feb 18, 2014
Flashnotifier API Example
View flashnotifierAPI.java
// 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 Aug 29, 2015
Sublet Group Post Rules
View sublet_posts.md

UT Sublets Group Post Rules

The bot checks for 3 main things:

  • Tag validity
  • Price reference
  • Length

Note: Capitalization doesn't matter.

View gist:78f082bdc0ac17797c7a
apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'com.demo'
version = '1.0.0'
sourceCompatibility = 1.7
repositories {
mavenCentral()
View HashUtil.java
/**
* 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);
}
View Username blacklist
about
account
add
admin
api
app
apps
archive
archives
auth
View caltrain.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ArraySet.java
/*
* 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
View 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
View okiobuffer.java
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));
You can’t perform that action at this time.