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
fn transliterate(ogham: &str) -> String { | |
ogham.chars().filter_map(|token| match token { | |
' ' => Some(" "), | |
'ᚁ' => Some("B"), | |
'ᚂ' => Some("L"), | |
'ᚃ' => Some("F"), | |
'ᚄ' => Some("S"), | |
'ᚅ' => Some("N"), | |
'ᚆ' => Some("H"), | |
'ᚇ' => Some("D"), |
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 python3 | |
import argparse | |
import string | |
import sys | |
def rotate(letters, offset): | |
return letters[offset:] + letters[:offset] | |
def cipher(message, map_dict): | |
return ''.join(map_dict.get(c, c) for c in message) |
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 python3 | |
import argparse | |
import string | |
import sys | |
CHARS = ("🇦", "🇧", "🇨", "🇩", "🇪", "🇫", "🇬", "🇭", "🇮", "🇯", "🇰", "🇱", "🇲", | |
"🇳", "🇴", "🇵", "🇶", "🇷", "🇸", "🇹", "🇺", "🇻", "🇼", "🇽", "🇾", "🇿") | |
OFFSET = ord('A') |
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
ᚳᛁ ᛉᛁ ᛋᛁ | |
ᛏᛁ ᛞᛁ ᛚᛁ | |
ᛈᛁ ᛒᛁ ᚠᛁ | |
ᚳᚫ ᛉᚫ ᛋᚫ | |
ᛏᚫ ᛞᚫ ᛚᚫ | |
ᛈᚫ ᛒᚫ ᚠᚫ | |
ᚳᚩ ᛉᚩ ᛋᚩ | |
ᛏᚩ ᛞᚩ ᛚᚩ |
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 | |
""" | |
This script aims to make it a little easier to work with ConceptNet | |
relationships using the raw data available. It extracts all of the semantic | |
relationships for English terms, and saves the results to multiple JSON files | |
-- one for each letter in the alphabet. | |
As of Jan 2015, this will require about 9 GB of disk space: | |
* conceptnet5_flat_json_5.3.tar.bz2 is 644 MB compressed, |
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 | |
# encoding: utf-8 | |
""" | |
Random Scrabble tiles! | |
""" | |
from __future__ import unicode_literals | |
from random import shuffle |
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
bot.scheduler.every '1h', :first_in => '1s' do | |
bot.log "Start unfollowing" | |
bot.twitter.friend_ids.each do |friend_id| | |
bot.log "Will unfollow ##{friend_id}" | |
begin | |
bot.twitter.unfollow(user_id=friend_id) | |
rescue Twitter::Error::TooManyRequests => error | |
bot.log "Rate limit exceeded; will stop unfollowing for now" | |
return | |
rescue Exception => error |
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
def str_to_binary(a_string): | |
return ' '.join(format(ord(c), 'b').zfill(8) for c in a_string) | |
def ello_string(a_string): | |
return str_to_binary(a_string).replace('0', 'O').replace('1', 'L') | |
print ello_string('ello orld') |
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 os | |
import twitter # pip install twitter | |
def post_tweet(text): | |
assert len(text) <= 140, 'tweet is too long' | |
auth = twitter.OAuth(os.environ['TWITTER_USER_TOKEN'], | |
os.environ['TWITTER_USER_SECRET'], | |
os.environ['TWITTER_API_KEY'], | |
os.environ['TWITTER_API_SECRET']) |
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
function __inky_tmux_attach() | |
{ | |
[ -n "$1" ] && session=$1 || session=main | |
tmux attach-session -d -t "$session" || tmux new-session -s "$session" | |
} | |
alias s='__inky_tmux_attach' |
NewerOlder