Skip to content

Instantly share code, notes, and snippets.

@DDRBoxman
DDRBoxman / create_images
Created November 2, 2011 03:05
Script to scale and create Android images at the correct dpi levels
#!/bin/bash
#Requires ImageMagick to be installed.
#Some builds of ImageMagick on OSX have problems generating the images correctly.
#This script scales and creates images at the correct dpi level for Android.
#It gets placed in a folder called res/drawable/source_images/ in your #Android project along with all your svg files.
#When creating svg files set the image size to the size that you want your hdpi images to be.
#To use simply run the create_images script from its folder and it will generate images for all the svg files.
@DDRBoxman
DDRBoxman / ink_create_images
Created December 12, 2011 17:00
Script to create / scale Android resources from vectors
#!/bin/bash
#Requires Inkscape to be installed.
#This script scales and creates images at the correct dpi level for Android.
#It gets placed in a folder called res/drawable/_source_images/ in your
#Android project along with all your svg files.
#When creating svg files set the image size to the size that you want your hdpi images to be.
#To use simply run the create_images script from its folder and it will generate images for all the svg files.
@DDRBoxman
DDRBoxman / Bypass.podspec
Created March 25, 2013 19:40
Bypass podspec
#
Pod::Spec.new do |s|
s.name = "Bypass"
s.version = "1.0"
s.summary = "Skip the HTML, Bypass takes markdown and renders it directly on Android and iOS."
s.homepage = "http://uncodin.github.com/bypass/"
s.license = 'Apache 2.0'
s.authors = { "Colin Edwards" => "colin@recursivepenguin.com", "Damian Carrillo" => "dcarrillo@ironclad.mobi" }
Intent pickIntent = new Intent();
pickIntent.setType("image/*");
pickIntent.setAction(Intent.ACTION_GET_CONTENT);
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File f = null;
try {
f = Util.createImageFile();
mCurrentPhotoPath = f.getAbsolutePath();
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@DDRBoxman
DDRBoxman / README.md
Last active January 22, 2016 15:45
Twitch Subber

Super crappy and thrown together as fast as possible :)

  • Install node and casperjs, and make sure you have python
  • Fill out fields in sub.js
  • Run check.py
  • Get first sub :)
@DDRBoxman
DDRBoxman / scrapereps.py
Created February 16, 2016 05:57
Get the reps in Texas
import requests
from bs4 import BeautifulSoup
import unicodecsv as csv
r = requests.get("https://www.txdirectory.com/online/txsenate/")
c = r.content
soup = BeautifulSoup(c, "html.parser")
reps = []
public class GameWispResponse<T> {
List<T> data;
Result result;
}
public class Result {
int status;
String message;
}
public class SigningClient implements Client {
final Client wrapped;
public SigningClient(Client client) {
wrapped = client;
}
@Override public Response execute(Request request) {
Request newRequest = sign(request);
return wrapped.execute(newRequest);
func highlight(conn *irc.Conn, channel string, user string, line string, args []string) {
rconn := pool.Get()
defer rconn.Close()
if !isMod(rconn, channel, user) {
log.Printf("User %s tried to access !quote on %s add and wasn't a mod\n", user, channel)
return
}
c := channel[1:]
resp, err := twitchClient.GetChannelVideos(c, true, 1)