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/python | |
# Rotate a pdf to landscape for Kindle | |
# http://gist.github.com/612853 | |
# coded by jong10 <jong10@gmail.com> | |
# Usage (example) | |
# > python rotate-pdf.py input.pdf output.pdf | |
# supress deprecated warnings | |
import warnings |
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/bash | |
# C code to PDF, coded by jong10 | |
# http://gist.github.com/638506 | |
for file in "$@" | |
do | |
o=`echo $file | sed "s/^.*\///g"` | |
output="$o.pdf" | |
enscript -T 4 --color -C -G -E "$file" -p - | ps2pdf - "$output" | |
echo "created: $output" |
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
# problem: http://club.filltong.net/codingdojo/27611 | |
# coded by jong10 | |
import unittest | |
# infix to prefix(s-expression) | |
# modified from http://news.ycombinator.com/item?id=284954 | |
def parse(s): | |
for operator in ["+-", "*/"]: | |
depth = 0 |
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/python | |
# coding: utf-8 | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEText import MIMEText | |
import email.Charset | |
GMAIL_ID = '??????@gmail.com' | |
GMAIL_PW = 'password' |
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
# problem: http://club.filltong.net/codingdojo/29104 | |
# solved: https://gist.github.com/946455 | |
# coded by jong10 | |
import unittest | |
def inserted(s, i, c): | |
return s[:i] + c + s[i:] | |
def moved(s): |
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 | |
# -*- coding: utf-8 -*- | |
# Adding exif datetime to pictures | |
# copyleft, coded by jong10 | |
# need: http://sourceforge.net/projects/exif-py/ | |
import EXIF | |
import sys, os | |
def rename(filename): | |
FIELD = 'EXIF DateTimeOriginal' |
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
// Topcoder SRM 523 template | |
// problem: http://community.topcoder.com/stat?c=problem_statement&pm=10957&rd=14548 | |
#include <iostream> | |
#include <cstdio> | |
using namespace std; | |
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) | |
// cut here start ------------------------------------------------------------- |
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
// Topcoder SRM 523 Div1 250pt | |
// problem: http://community.topcoder.com/stat?c=problem_statement&pm=10957&rd=14548 | |
// coded by jong10 | |
#include <iostream> | |
using namespace std; | |
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) | |
// cut here start ------------------------------------------------------------- |
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 ruby | |
require 'open-uri' | |
page = open("http://www.kbdmania.net/xe/?mid=market&category=&search_target=title&search_keyword=%ED%95%B4%ED%94%BC%ED%95%B4%ED%82%B9") {|f| f.read} | |
links = page.scan(/<strong class="category" >판매<\/strong>[ \t\r\n]*<a href=[^<]*<\/a>/m).map {|a| a.scan(/(document_srl=)([^"]*)(">)([^<]*)/)[0]} | |
links.each {|_, no, _, title| puts "http://www.kbdmania.net/xe/market/#{no} => #{title}"} |
OlderNewer