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
# -*- coding: utf-8 -*- | |
# Welcome to the Chinese Support Add-on's field edition ruleset. | |
# Here, you can tweak the note editor helper's behavior to your liking. | |
# | |
# If you messed things up, you can safely delete file | |
# addons/chinese/edit_behavior.py from your Anki directory. | |
# It will be recreated the next time you restart Anki. | |
# | |
# You can read about all available functions at: | |
# https://github.com/ttempe/chinese-support-addon/wiki/Edit-behavior |
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
require 'date' | |
require 'minitest/autorun' | |
class Time | |
def self.normalize time | |
dt = DateTime.parse(time).to_time.utc | |
Time.utc(Time.now.year, nil, nil, dt.hour, dt.min) | |
end | |
def inbetween start_time, end_time |
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
class Thing < Struct.new(:color) | |
@@things = {} | |
def self.parse description | |
type_name, color = description.split | |
@@things[type_name].new color | |
end | |
def self.type_code code | |
@@things[code] = self |
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 | |
# | |
# Spam your phonebook (Nokia) with Christmas cheer. | |
# | |
# Usage: merryspam.py vcards names | |
# | |
# How do I get the "vcards"? | |
# | |
# gnokii --getphonebook ME 1 end -v > ME.vcards | |
# gnokii --getphonebook SM 1 end -v > SM.vcards |
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 logging | |
import dbus | |
import dbus.service | |
import gobject | |
# Set DBUS as the default MainLoop. | |
from dbus.mainloop.glib import DBusGMainLoop |
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 | |
# | |
# any-month.py | |
# | |
# What did you listen to the most on any given month? (via last.fm) | |
# | |
# Example: | |
# | |
# $ find ~/public_html/mixtape -name index.xspf -print0 | xargs -0 ./any-month.py | |
# Wild Orchid Children where the mexican boys go |
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 -e | |
# | |
# jwz wants to try DJabberd. | |
# | |
# Hope you're using Debian. | |
sudo aptitude install \ | |
perl \ | |
libdanga-socket-perl \ | |
libdigest-hmac-perl \ |
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 tango.sys.SharedLib; | |
import tango.text.convert.Format; | |
import tango.util.log.Trace; | |
bool load(char[] name) { | |
if (auto lib = SharedLib.load(name)) { | |
Trace.formatln(Format("{} loaded.", name)); | |
return true; | |
} |
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 -e | |
deploy () | |
{ | |
VERSION="2.5" | |
PYTHON="$(which python$VERSION)" | |
export PYTHONPATH="$1/lib/python$VERSION/site-packages" | |
mkdir -p $PYTHONPATH |
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
# | |
# At YOW!2010, Guy Steele gave a great talk entitled "How to Think about | |
# Parallel Programming---Not!" | |
# | |
# In it, he presented an implementation of a divide and conquer strategy for | |
# splitting a string. | |
# | |
# His solution was written in Fortress. | |
# | |
# People nearby me were confused. |
OlderNewer