This file contains hidden or 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
desc 'Create a new post with title "%Y-%m-%d"' | |
task :new do | |
Rake::Task[:new_post].invoke(Time.now.strftime("%Y-%m-%d")) | |
end |
This file contains hidden or 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 'ripper' | |
def space(indent) | |
' ' * indent | |
end | |
def parse(sexp, indent=0) | |
sexp.each {|elem| |
This file contains hidden or 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 | |
import logging | |
class Logger(object): | |
def __init__(self, name='logger', level=logging.DEBUG): | |
self.logger = logging.getLogger(name) | |
self.logger.setLevel(level) |
This file contains hidden or 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
from pprint import pprint as pp | |
class Foo(object): | |
def __init__(self, *args): | |
self.val = args[0] | |
args = range(10) | |
# objs = [] |
This file contains hidden or 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 | |
import sys | |
import site | |
site.addsitedir('/usr/local/lib/python2.7/site-packages') | |
from PySide import QtCore, QtGui, QtWebKit | |
app = QtGui.QApplication(sys.argv) | |
view = QtWebKit.QWebView() | |
view.load(QtCore.QUrl('http://google.com')) |
This file contains hidden or 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 | |
import sys | |
import site | |
site.addsitedir('/usr/local/lib/python2.7/site-packages') | |
from PySide import QtCore, QtGui, QtWebKit | |
app = QtGui.QApplication(sys.argv) | |
view = QtWebKit.QWebView() | |
view.settings().setAttribute(QtWebKit.QWebSettings.DeveloperExtrasEnabled, True) |
This file contains hidden or 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 | |
import os | |
import sys | |
import site | |
site.addsitedir('/usr/local/lib/python2.7/site-packages') | |
from PySide import QtCore, QtGui, QtWebKit | |
html = """ | |
<!doctype html> |
This file contains hidden or 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 | |
import os | |
import sys | |
import site | |
site.addsitedir('/usr/local/lib/python2.7/site-packages') | |
from PySide import QtCore, QtGui, QtWebKit | |
class WebView(QtWebKit.QWebView): |
This file contains hidden or 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
var Template = (function() { | |
var _cache = {}; | |
function render(id, params) { | |
if (_cache[id]) { | |
return _cache[id](params); | |
} | |
$('script[type="text/template"]').each(function(i, e) { | |
if (id === e.id) { |
This file contains hidden or 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 'nokogiri' | |
require 'open-uri' | |
require 'pdfkit' | |
if __FILE__ == $0 | |
url = ARGV[0] | |
doc = Nokogiri::HTML(open(url)) | |
filename = doc.title ? "#{doc.title.strip}.pdf" : "#{url}.pdf" |
OlderNewer