This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Python dice rolling and parsing | |
# Embed into a bot, service, whatever... | |
# Was bored... | |
import random | |
import re | |
import sys | |
from exceptions import ValueError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GL_FILES="libGLESv1_CM_POWERVR_SGX530_125.so libGLESv2_POWERVR_SGX530_125.so libEGL_POWERVR_SGX530_125.so" | |
HW_FILES="gralloc.omap3.so overlay.omap3.so" | |
if [[ $(adb devices | wc -l) -lt 3 ]]; then | |
echo Device not found | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Process logs for stats | |
my $znc_playback = 0; | |
while (my $line = <>) { | |
if($line =~ /^[0-9]{1,2}:[0-9]{1,2} < \*\*\*> Buffer Playback\.\.\.$/) { | |
$znc_playback = 1; | |
} elsif($line =~ /^[0-9]{1,2}:[0-9]{1,2} < \*\*\*> Playback Complete\.$/) { | |
$znc_playback = 0; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
major minor #blocks name | |
8 0 312571224 sda | |
8 1 103392 sda1 | |
8 2 104755200 sda2 | |
8 3 1 sda3 | |
8 4 147979264 sda4 | |
8 5 40001818 sda5 | |
8 6 4000153 sda6 | |
11 0 1048575 sr0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# Format a gitlog with html to look nice (for senior design doc) | |
# usage: | |
# perl gitlog.pl < logfile.txt > logfile.html | |
# - or - | |
# git log --pretty=fuller | perl gitlog.pl > logfile.html | |
$commit = {}; | |
$state_log = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl -w | |
use strict; | |
print "<style name=\"" . shift . "\">\n"; | |
while (<>) { | |
print " <item name=\"$1\">$2</item>\n" if ($_ =~ /\s*([^=]+)=\"([^\"]+)\"/i); | |
} | |
print "</style>\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# usage: ./logconcat.py output.log [list, of, input, files] | |
# Eventually I'll put all log entries in a db for more fun. | |
from datetime import datetime | |
class LogEntry(): | |
def __init__(self, date, entry): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ryands.android; | |
import android.app.Activity; | |
import android.os.Bundle; | |
/** | |
* A proper splash screen for android. | |
*/ | |
public class SplashActivity extends Activity { | |
@Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
# This will favor :symbol keys over string keys | |
def method_missing (method, *args) | |
if has_key? method.to_sym | |
self[method.to_sym] | |
elsif has_key? method.to_s | |
self[method.to_s] | |
else | |
super | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Builder { | |
public static void main(String... args) { | |
DogeBuilder builder = new DogeBuilder(); | |
builder.setSo("design") | |
.setSuch("pattern") | |
.setVery("software engineering"); | |
System.out.println(builder.build()); | |
} |
OlderNewer