Skip to content

Instantly share code, notes, and snippets.

View TyOverby's full-sized avatar
😸

Ty Overby TyOverby

😸
View GitHub Profile
@TyOverby
TyOverby / gist:1041525
Created June 22, 2011 23:15
Gets all of the elements in an html table
Url input = new Url("http://what.cd/forums.php?action=viewforum&forumid=7");
Document doc = Jsoup.parse(input,500);//500 is the timeout
Elements rowsa = content.getElementsByClass("rowa");
Elements rowsb = content.getElementsByClass("rowb");
Elements totalRows = rowsa+rowsb //don't know what to do here, but concatinate them if possible
for (Element row : totalRows) {
for(Element data : row.children()){
Module Module1
Private Delegate Sub Numbering()
Sub Main()
Dim Fns As Numbering
'Fns = New Numbering(AddressOf FnOdd)
'Fns()
'Fns = New Numbering(AddressOf FnEven)
'Fns()
'Fns = New Numbering(AddressOf FnFours)
'Fns()
@TyOverby
TyOverby / EntryPoint.java
Created September 30, 2011 06:32
Rotates a point around another point
public class EntryPoint {
public static class Point{
public final double x;
public final double y;
public Point(double x,double y){
this.x = x;
this.y = y;
}
@TyOverby
TyOverby / download.sh
Created May 24, 2012 21:36
Place these files inside the @DayZ folder. Wget and unrar are required.
# !/bin/bash
wget -r -m -l 1 "http://$1"
@TyOverby
TyOverby / gist:2816527
Created May 28, 2012 00:29
An auto-resizing java panel
import java.awt.EventQueue;
public class GridBased extends JFrame {
private static final long serialVersionUID = -680006681909001923L;
private JPanel contentPane;
private JButton[][] grid = new JButton[6][5];
@TyOverby
TyOverby / SplitInput.java
Created May 31, 2012 22:26
Splits a string by commas and converts them into integers.
public class SplitInput {
public static void main(String... args){
// This is your input string. It can be read from the console or
// via other methods of io, but I just have it the code for the hell of it
String input = "20,40,30,54,17";
// Now we split the string into an array of strings with the "split" method.
// It creates an array of strings that were seperated by the comma.
String[] afterSplit = input.split(",");
public class Test {
private static class Foo{
}
private static class Bar{
}
public static void main(String... args){
Foo[] fooArray = new Foo[10];
@TyOverby
TyOverby / download.sh
Created June 17, 2012 07:41
dayz installer
# !/bin/bash
wget -r -m -l 1 "http://$1"
@TyOverby
TyOverby / autosteriogram.pfp
Created August 29, 2012 18:22
Create an autosteriogram
BEGIN FORMULA BARS
0#|#3d#|#512,256#|#*,*#|#(sqr(x-256)+sqr(y-128))/100#|#c#|##|#
1#|#KOALA#|##|#*,*#|#@C:\Users\Public\Pictures\Sample Pictures\Koala.jpg#|#c#|##|#
2#|#noise#|#256,256#|#1,*#|#RGB(Red1(x,y) mod 2 * 256,Green1(x,y) mod 2 * 256,Blue1(x,y) mod 2 * 256)#|#c#|##|#
2#|#noise#|##|#2,*#|#(Red1(x,y)+Green1(x,y)+Blue1(x,y))/3#|#c#|##|#
3#|#final#|#512,256#|#0,2#|#if x<250*(1/(1+800/(100+source1(x,y)))) then source2(x,y mod h2) else dest(x-250*(1/(1+800/(100+source1(x,y)))),y)#|#c#|##|#
#!/usr/bin/perl
use strict;
use warnings;
use LWP;
# $prerequisites->{course}->{requirement}
my $prerequisites = {};
my $ua = LWP::UserAgent->new();