Skip to content

Instantly share code, notes, and snippets.

@i-blis
i-blis / x.js
Created September 8, 2009 15:42
CmdUtils.makeSearchCommand({
names: ["perldoc"],
url: "http://perldoc.perl.org/search.html?q={QUERY}",
description: "Search the Perl 5.10.1 documentation.",
author: { name: "i-blis", email: "i-blis@yandex.ru" },
})
CmdUtils.makeSearchCommand({
names: ["cpan"],
@i-blis
i-blis / pdfcrop.simple.pl
Created November 10, 2010 07:19
Split double page PDF in two
#!/usr/bin/env perl
use strict; use warnings;
use PDF::API2;
my $filename = shift =~ /\.pdf$/i
or die "Be kind enough to provide a PDF file to split as argument\n";
my $oldpdf = PDF::API2->open($filename);
my $newpdf = PDF::API2->new;
for my $page_nb (1..$oldpdf->pages) {
@i-blis
i-blis / pdfoutlinedump.py
Created March 27, 2011 23:34
Dump PDF outline (ToC)
#!/usr/bin/env python
# encoding: utf-8
"""
pdfoutlinedump.py
"""
from optparse import OptionParser
from pyPdf import PdfFileReader
@i-blis
i-blis / gist:1986668
Created March 6, 2012 14:54 — forked from nolanw/fscript.rb
Inject F-Script into any app on 10.7 Lion
#!/usr/bin/env ruby
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
if ARGV.empty?
puts "Usage: #{$0} process_name"
exit
end
GDB = IO.popen("gdb", 'w')
@i-blis
i-blis / hubic.rb
Created May 8, 2012 21:05
How to get Hubic Webdav credentials
#!/usr/bin/env ruby
# hubic.rb Get credentials to Webdav server of Hubic account
require 'httpclient'
require 'json'
require 'optparse'
require 'highline/import'
module Hubic
extend self
@i-blis
i-blis / keynote_export.rb
Created May 31, 2012 18:43
Export notes from Keynote to OmniOutliner
#!/usr/bin/env macruby
framework 'scriptingbridge'
keynote = SBApplication.applicationWithBundleIdentifier("com.apple.iWork.Keynote")
outliner = SBApplication.applicationWithBundleIdentifier("com.omnigroup.OmniOutlinerPro3")
document = outliner.classForScriptingClass('document').new
outliner.documents << document
document.get.statusVisible = false
document.get.columnTitleStyle.attributes[29].value = 'center'
@i-blis
i-blis / getgist.rb
Created November 28, 2012 17:51
Download gist files to current directory
#!/usr/bin/env ruby
require 'github_api'
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.on("-a", "--add-gist-id", "Add gist ID to output filename") do |v|
options[:add] = true
end
@i-blis
i-blis / lazy-reddit.clj
Created May 6, 2013 01:13
Building a lazy sequence out of a given subreddit's entries
(ns playground.experiments.lazy-reddit
(:require [net.cgrand.enlive-html :as html]))
(defn subreddit-url [name]
(str "http://www.reddit.com/r/" name))
(defn fetch-page [url]
(html/html-resource (java.net.URL. url)))
(defn make-integer [n]
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@i-blis
i-blis / _.md
Created March 29, 2014 00:11
movable point on circle