Skip to content

Instantly share code, notes, and snippets.

View SQiShER's full-sized avatar
👨‍👩‍👧
Work, Family, Sleep, Repeat

Daniel Bechler SQiShER

👨‍👩‍👧
Work, Family, Sleep, Repeat
View GitHub Profile
@SQiShER
SQiShER / IsTheAppleStoreOnline.sh
Created May 17, 2012 14:14
Script for OS X that checks every 2 minutes whether the Apple Store is online and notifies you as soon as it's back online. Great if you want to buy a new product before its sold out!
#!/bin/sh
while [ true ]
do
if [ $(curl -XGET "http://store.apple.com/de" | grep "We'll be back soon" | wc -l) -eq 0 ]
then
say -v Alex 'The Apple Store is back online!'
growlnotify -m 'The Apple Store is back online!' -t 'Apple Store'
fi
sleep 120
@SQiShER
SQiShER / gist:1111424
Created July 28, 2011 11:41
This is the reason why Lucene scoring was a little bit off for searches with very short terms (if I recall correctly)
private final Similarity similarity = new DefaultSimilarity()
{
private static final long serialVersionUID = 1L;
@Override
public byte encodeNormValue(final float f)
{
return SmallFloat.floatToByte52(f);
}