View profile_tasks.py
import datetime | |
import os | |
import time | |
# Ansible 1.9 and 2.0 compatibility | |
try: | |
from ansible.plugins.callback import CallbackBase | |
parent_class = CallbackBase | |
except ImportError: | |
parent_class = object |
View tarball.sh
#!/bin/sh | |
# Most of the time, you just want a .tar.gz of a folder, regardless of | |
# where you are. This is a small script that does it and put the result | |
# in /tmp. If you have xsel installed, it copied to your clipboard the | |
# destination file. | |
set -e | |
file="$1" |
View main.rb
def score(r) | |
return 0 if r.nil? | |
weight = { | |
:name => 1, | |
:street_number => 1, | |
:street_name => 1, | |
:suburb => 1, | |
:zero => 0 |
View library.rb
class Library | |
# Constructor. Initialize the good library according to the name given in parameter. | |
def initialize(library = '') | |
case library | |
when /sutherland/i | |
return Alexandria::Sutherland::Library.new | |
else | |
return Alexandria::Library.new | |
end | |
end |
View .vimrc
let g:c_80_detect = 0 | |
function! Change80Detect() | |
if g:c_80_detect == 1 | |
match | |
let g:c_80_detect = 0 | |
else | |
match ErrorMsg '\%>80v.\+' | |
let g:c_80_detect = 1 | |
endif | |
endfunction |
View .vimrc
if !has("gui_running") | |
"colorscheme candycode " yum candy | |
" I pretty much only like this scheme if I can use SIMBL with terminal | |
" colors: | |
" (http://www.culater.net/software/TerminalColors/TerminalColors.php) | |
" to change the really hard-to-read dark blue into a lighter shade. | |
" Or; Use iterm with Tango colors | |
colorscheme candy | |
"colorscheme rdark |
View .irbrc
%w|rubygems wirble hirb utility_belt|.each do|lib| | |
begin | |
require lib | |
rescue LoadError => err | |
warn "Couldn't load an irb gem: #{err}" | |
end | |
end | |
# wirble (colors) | |
Wirble.init |
View ballarat.csv.sql
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ballarat]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) | |
drop table [dbo].[ballarat] | |
GO | |
CREATE TABLE [dbo].[ballarat] ( | |
[id] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , | |
[streetname] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , | |
[suburb] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , | |
[postcode] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , | |
[precinct] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , |
View gist:430880
let g:netrw_preview=1 | |
""""""""""""""""""""""""""""""""""""""""""""" MAP | |
map <down> <ESC>:bn<RETURN> | |
map <left> <ESC>:NERDTreeToggle<RETURN> | |
map <right> <ESC>:Tlist<RETURN> | |
map <up> <ESC>:bp<RETURN> | |
map <F5> <Esc>:tabnew<CR>:read !svn diff<CR>:setf diff<CR>:w! /tmp/vim-diff-file.tmp<CR> | |
"set gfn=Inconsolata\ Medium\ 12 |
View checkmyplaces.rb
require 'yaml' | |
require 'rubygems' | |
require 'net/ssh' | |
require 'net/ssh/version' | |
places = YAML.load_file('places.yaml') | |
threads = [] | |
places.each do |place| | |
threads << Thread.new(place) do |p| |