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/local/bin/python | |
# -*- coding:utf-8 -*- | |
import smtplib | |
import socket | |
from email.MIMEText import MIMEText | |
from email.Header import Header | |
from email.Utils import formatdate | |
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
<source> | |
type tail | |
format apache | |
path /usr/local/apache2/logs/access_log | |
tag mongo.apache | |
</source> | |
<match mongo.**> | |
type mongo |
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 | |
mv ./System/.localized ./System/.localized.disable | |
mv ./Users/.localized ./Users/.localized.disable | |
mv ./Applications/.localized ./Applications/.localized.disable | |
mv ./Library/.localized ./Library/.localized.disable | |
mv ./System/Library/.localized ./System/Library/.localized.disable | |
mv ~/Desktop/.localized ~/Desktop/.localized.disable | |
mv ~/Documents/.localized ~/Documents/.localized.disable |
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
all_signal=(▁ ▃ ▅ ▇ ) | |
current=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | egrep "agrCtlRSSI|state|lastTxRate| SSID" | cut -d: -f2 | tr "\\n" ";" | sed 's/^[ ]//g'` | |
if [ "$current" == "" ] | |
then | |
echo "(WIFI off)" | |
fi | |
strength=`echo $current | cut -d";" -f1-1 | cut -d" " -f2-` |
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
Index: solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java | |
=================================================================== | |
--- solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java (revision 1245584) | |
+++ solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java (working copy) | |
@@ -57,7 +57,7 @@ | |
String xml = | |
"<random>" + | |
" <document>" + | |
- " <node name=\"id\" enhance=\"2.2\" value=\"12345\"/>" + | |
+ " <node name=\"id\" value=\"12345\"/>" + |
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
<!-- stderrout --> | |
<New id="ServerLog" class="java.io.PrintStream"> | |
<Arg> | |
<New class="org.mortbay.util.RolloverFileOutputStream"> | |
<Arg><SystemProperty name="jetty.logs" default="."/>/logs/yyyy_mm_dd.stderrout.log</Arg> | |
<Arg type="boolean">false</Arg> | |
<Arg type="int">90</Arg> | |
<Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>JST</Arg></Call></Arg> | |
<Get id="ServerLogName" name="datedFilename"/> | |
</New> |
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/local/bin/python | |
import re | |
def isbn_strip(isbn): | |
""" | |
>>> isbn_strip('1-58488-540-8') | |
'1584885408' | |
>>> isbn_strip('978-4-08-870413-5') | |
'9784088704135' |
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/local/bin/python | |
# vim:fileencoding=utf-8 | |
def nonull(stream): | |
for line in stream: | |
yield line.replace('\x00', '') |
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/local/bin/python | |
# vim:fileencoding=utf-8 | |
from optparse import OptionParser | |
import httplib | |
import urllib | |
import settings | |
usage = "usage: %prog [Option] tel_to_number" | |
parser = OptionParser(usage=usage) |
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
-module(fibonacci). | |
-export([fib_tree/1]). | |
-export([fib/1]). | |
fib_tree(0) -> | |
0; | |
fib_tree(1) -> | |
1; | |
fib_tree(N) -> | |
fib_tree(N - 1) + fib_tree(N - 2). |