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
import java.util.AbstractList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.List; | |
public class ConsList<E> extends AbstractList<E> implements List<E> { | |
private E element; | |
private List<E> parent; |
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
function once (fn) { | |
var done = false, result; | |
function _once_ () { | |
if(!done) { | |
result = fn.apply(this,Array.prototype.slice.call(arguments)) | |
done = true; | |
} | |
return result; | |
} | |
return _once_; |
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
import string,cgi,time, datetime | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
try: | |
self.send_response(503) # let bots know whats up | |
self.send_header('Content-type','text/html') | |
self.end_headers() | |
self.wfile.write('<!DOCTYPE html>\n<meta charset=utf-8 />\n<title>Notification page</title>\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
#!/bin/bash | |
printf '0x%08x' $(date +%s) |
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 de.bxt.util; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
/** |
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 abstract class Bottom { | |
public static <E> E get() { | |
return null; | |
} | |
} |
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 | |
usestdi=off | |
filename=$1 | |
if [ $1 = "-h" ] ; then | |
echo "Usage: $0 mdfile [outfile]"; exit | |
fi | |
if [ $1 = "-" ] ; then | |
usestdi=on |
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
/** | |
* Return something as filename-save string. | |
* | |
* Result will contain only 0-9, a-z and "-". | |
* It converts german umlauts, you might want | |
* to add some conversions for your target | |
* language. | |
*/ | |
function filesc(str) { |
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
-- Tip: You can use IF() and AVG() together to get a percentage value | |
-- without doing subquerys | |
-- - | |
-- Basic usage: | |
-- SELECT AVG(IF( predicate ,100,0)) as percentage FROM table | |
-- Example: | |
-- - | |
SELECT | |
AVG(IF(f.mid,100,0)) as `percentage filed` | |
FROM |
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
// This is a little demo File on how to bind event listeners | |
// to own, non-DOM objects with jQuery. | |
// Since calling the default action is calling the identically | |
// named methods of our custom action and that would usually | |
// mean triggering the event again we use this handy callback: | |
function preventSelfcallCallback (event) { | |
event.preventDefault(); | |
} |