Skip to content

Instantly share code, notes, and snippets.

@ndreas
ndreas / changes.txt
Created January 8, 2011 10:21
Changes to the Quicksilver iTerm plugin to make it work with iTerm
The changes were made twice in the binary "iTerm Module" since the script is embedded twice. I just opened the binary in Vim and searched for "activate" to find the scripts.
Changes:
- Create a new window instead of a tab (I prefer it that way)
- Launch the default session instead of creating a new session
- Disable the bash-commands since it overrode my default shell, zsh
The strange indentation in the modified file is due to the fact that the binary b0rks if the string length is changed. If it does not work, try removing or adding characters in the script. Quicksilver generates an error message on startup (for example in Console.app) if there is something wrong with the binary.
@roustem
roustem / ipad2.sh
Created March 24, 2011 18:02
Check for iPad 2 availability in Canadian Apple Store
#! /bin/bash
while [ 1 ]
do
curl -s 'http://store.apple.com/ca/browse/home/shop_ipad/family/ipad/select?mco=MjE2MjYyNzA' | grep -i "Currently unavailable" > /dev/null
if [ $? == 0 ]; then
echo "`date` — not available"
else
echo "`date` — available"
say "iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available! iPad 2 Is Available!"
break
#!/usr/bin/ruby
%w[fileutils ftools set zlib].each do |filename|
require filename
end
# Load the Marshal dump to a hash
def load file_name
begin
file = Zlib::GzipReader.open(file_name)
"""
A redis autocomplete example for multi-word phrases.
Based on:
Ruby original: http://gist.github.com/574044
Python original: https://gist.github.com/577852
See options below for usage
Requires http://github.com/andymccurdy/redis-py/
@karmi
karmi / elasticoverflow.rb
Created May 3, 2011 09:32
Importing and searching RSS with ElasticSearch and Tire
# =======================================================
# Importing and searching RSS with ElasticSearch and Tire
# =======================================================
#
# This script downloads, parses and indexes Stackoverflow RSS feed with ElasticSearch
# via the [Tire](https://github.com/karmi/tire) Rubygem.
#
# Requirements
# ------------
#
@natesilva
natesilva / markdown.vim
Created May 6, 2011 23:44
Vim: Preview a Markdown document in the default browser on Windows or Mac OS X
"
" While editing a Markdown document in Vim, preview it in the
" default browser.
"
" Author: Nate Silva
"
" To install: Place markdown.vim in ~/.vim/ftplugin or
" %USERPROFILE%\vimfiles\ftplugin.
"
" To use: While editing a Markdown file, press ',p' (comma p)
@karmi
karmi / .gitignore
Created May 15, 2011 11:15
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@karmi
karmi / elastic_search_ngram_analyzer_for_urls.sh
Created May 24, 2011 15:32
NGram Analyzer in ElasticSearch
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/ngram_test
curl -X PUT localhost:9200/ngram_test -d '
{
"settings" : {
"index" : {
"analysis" : {
# ========================================
# Testing multiple analyzers per field
# ========================================
# Setup
curl -s -X DELETE 'http://localhost:9200/news_test/'
# Create index with settings and mapping
curl -s -X PUT 'http://localhost:9200/news_test' -d '
{
@fuba
fuba / default.js
Created May 31, 2011 16:36
dotjs-ify my greasemonkey user scripts
function GM_getValue (key) {
var value = localStorage.getItem('GM_'.key);
if ('undefined' == typeof(value)) {
return;
}
return value;
}
function GM_setValue (key, value) {
localStorage.setItem('GM_'.key, value);