Skip to content

Instantly share code, notes, and snippets.

View skammer's full-sized avatar
🐱
may or may not be a cat

Max Vasiliev skammer

🐱
may or may not be a cat
View GitHub Profile
require 'rubygems'
require 'blather/client'
setup 'skammer@jabber.ru', 'pass'
when_ready { puts "Connected ! send messages to #{jid.stripped}." }
subscription :request? do |s|
write s.approve!
end
<error>There is no thread suspended at the time and therefore no context to execute 'next'</error>
CmdUtils.CreateCommand({
name: "flip",
execute: function(){
var doc = CmdUtils.getDocument();
jQuery(doc.body).css("-moz-transform", "rotate(180deg)");
}
});
CmdUtils.CreateCommand({
"=============================================================================
" File: gist.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 03-Jul-2009.
" Version: 2.7
" WebPage: http://github.com/mattn/gist-vim/tree/master
" Usage:
"
" :Gist
" post whole text to gist.
// replaced this
$(document).ready(function() {
if ($.fn.corner) $('.corner').corner()
})
// with this
.corner {
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
padding: 3px;
ruby -e "require 'webrick';s=WEBrick::HTTPServer.new :Port=>3001,:DocumentRoot=>Dir.pwd;trap('INT'){s.shutdown};s.start"
object ToRome {
sealed class RomeDigit(val value: Int)
case object I extends RomeDigit(1)
case object V extends RomeDigit(5)
case object X extends RomeDigit(10)
case object L extends RomeDigit(50)
case object C extends RomeDigit(100)
case object D extends RomeDigit(500)
@skammer
skammer / license
Created January 28, 2010 02:04 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
require 'rubygems'
require 'sinatra'
require 'datamapper'
require 'dm-paperclip'
require 'haml'
require 'fileutils'
APP_ROOT = File.expand_path(File.dirname(__FILE__))
DataMapper::setup(:default, "sqlite3://#{APP_ROOT}/db.sqlite3")
" Simply swaps lines up and down. No rocket science here.
function! s:swap_lines( n1, n2 )
let line1 = getline( a:n1 )
let line2 = getline( a:n2 )
call setline( a:n1, line2 )
call setline( a:n2, line1 )
endfunction
function! s:swap_up()