Skip to content

Instantly share code, notes, and snippets.

<?php
$hieroglyph_qwerty = explode("\n", <<<EOF
1234567890-^\
!"#$%&'()~=~|
qwertyuiop@[
QWERTYUIOP`{
asdfghjkl;:]
ASDFGHJKL+*}
zxcvbnm,./\
ZXCVBNM<>?_
@poochin
poochin / jconv.js
Created December 29, 2010 16:01
CP932_UTF8 or UTF8_CP932 on JS
var jconv = new (function()
{
function jconv() { return this; }
// cp932(ms_sjis) & utf16be map
// http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT
// array is set even & odd [cp932, utf16be, cp932, utf16be, ...]
var tuple_cp932_utf16be =
[0x00,0x0000,0x01,0x0001,0x02,0x0002,0x03,0x0003,0x04,0x0004,
0x05,0x0005,0x06,0x0006,0x07,0x0007,0x08,0x0008,0x09,0x0009,
@poochin
poochin / jconv.js
Created December 30, 2010 12:03
SJIS(==CP932)/EUC-JP/UTF8(+UTF16be) Conversion
/**
* Running test code for CLI MODE.
* Test code exists bottom.
*/
var RUN_TEST = false;
/**
* jconv.js
* Usage:
* load this script.
twttr.app.currentPage().repositionDetailsPane = function () {
if (!twttr.decider.goodAtCss()) {
return
}
var B = $('.details-pane-outer', this); // this.$find(".details-pane-outer");
if (this.windowHasHorizontalScroll()) {
var C = twttr.$win.scrollTop();
B.addClass("tracking-vertically");
B.css({
"margin-top": C,
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import hashlib
import random
import base64
import hmac
import urllib2
import urlparse
from xml.dom.minidom import NodeList
def getChildsByTagName(dom, tagName, **attrs):
'''return NodeList of tagName[attrs] from dom'''
nl = NodeList()
for node in dom.childNodes:
if hasattr(node, 'tagName') and node.tagName == tagName:
for k, v in attrs.iteritems():
if node.getAttribute(k) != v:
break
#!/usr/bin/python
# -*- coding: utf-8 -*-
# scraping newer manga of club sunday.
import re
from urllib import urlopen
from BeautifulSoup import BeautifulSoup
url = 'http://club.shogakukan.co.jp/kod/new.html'
@poochin
poochin / gist:950489
Created May 1, 2011 13:15
Tumblr Photos
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys, os, getpass
import cookielib, urllib, urllib2
from optparse import OptionParser
from sqlalchemy import create_engine, Table, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
class TestCombination(unittest.TestCase):
''' to check combi function '''
def setUp(self):
pass
#!/usr/bin/python
# -#- coding: utf-8 -*-
import unittest
class TestHorner(unittest.TestCase):
def setUp(self):
self.factors = (1, 2, 3, 4, 5)