This file contains 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 | |
import sys | |
import urllib | |
import chardet | |
import os | |
orig = sys.argv[1] | |
rawdata = urllib.urlopen(orig).read() | |
enc = chardet.detect(rawdata)['encoding'] |
This file contains 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
import java.util.*; | |
import java.math.*; | |
public class MapVsMap { | |
static final int MAP_SIZE = 100000; | |
static final int STR_LEN = 10; | |
static final int ROUNDS = 10; | |
static final char[] chars = { | |
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', |
This file contains 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 | |
# | |
# Tools for the Extra Bored | |
# brought to you by Edward Samson | |
# | |
# time-to-uwian | |
# | |
# If you turn on your computer as soon as you get to work, this script will | |
# show how much longer you have to wait before you can leave. | |
# |
This file contains 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
SELECT concat(table_schema,'.',table_name), | |
concat(round(table_rows/1000000,2),'M') rows, | |
concat(round(data_length/(1024*1024*1024),2),'G') DATA, | |
concat(round(index_length/(1024*1024*1024),2),'G') idx, | |
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size, | |
round(index_length/data_length,2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length+index_length DESC LIMIT 20; |
This file contains 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
private static final ${LOG_TYPE type="org.slf4j.Logger" default="Logger" editable=false} log = | |
${LOG_FACT type="org.slf4j.LoggerFactory" default="LoggerFactory" editable=false}.getLogger(${classVar editable="false" currClassName default="getClass()"}.class); |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%r [%thread] %-5level %logger - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<root> | |
<level value="error" /> | |
<appender-ref ref="STDOUT" /> |
This file contains 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
<#if licenseFirst??> | |
${licenseFirst} | |
</#if> | |
${licensePrefix}Copyright ${date?date?string("yyyy")} Edward Samson | |
<#if licenseLast??> | |
${licenseLast} | |
</#if> |
This file contains 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
diff -ur Stinger-2.2/src/org/owasp/stinger/Stinger.java Stinger-2.2.2/src/org/owasp/stinger/Stinger.java | |
--- Stinger-2.2/src/org/owasp/stinger/Stinger.java 2006-11-21 21:11:16.000000000 +0800 | |
+++ Stinger-2.2.2/src/org/owasp/stinger/Stinger.java 2007-12-20 11:04:30.000000000 +0800 | |
@@ -44,12 +44,15 @@ | |
private static RuleSet set = null; | |
+ private static boolean debug = false; | |
+ | |
private Stinger() { |
This file contains 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/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
This file contains 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
import javax.annotation.processing.SupportedOptions; | |
@SupportedOptions("debug") // declare the `debug` option | |
public final class InYourProcessor extends AbstractProcessor { | |
/** | |
* This is now your logging routine. | |
*/ | |
private void log(String msg) { | |
if (processingEnv.getOptions().containsKey("debug")) { |
OlderNewer