Skip to content

Instantly share code, notes, and snippets.

@doda-zz
doda-zz / string_multiply.py
Created November 21, 2012 19:58 — forked from peterldowns/string_multiply.py
Efficient string multiplication in Python
import timeit
test_str = "hello world|"
test_times = 1000
def test_str_add():
result = ""
for i in xrange(test_times-1):
result += test_str
return result
@doda-zz
doda-zz / gfm.rb
Created July 19, 2012 19:45 — forked from peterhellberg/gfm.rb
GitHub Flavored Markdown parser for use with Jekyll and Marked.app
#!/usr/bin/env ruby
require 'rubygems'
require 'redcarpet'
require 'pygments.rb'
class HTMLwithPygments < Redcarpet::Render::HTML
def block_code(code, language)
Pygments.highlight(code, :lexer => language.to_sym, :options => {
:encoding => 'utf-8'
})
#!/usr/bin/env python
import sys
import datetime
import requests
import dateutil.parser
from BeautifulSoup import BeautifulSoup
import time
import datetime
import sys