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
# rbd at mac-mini in ~/Sites/iseetheline.ru on git:master x [23:27:40] | |
$ python | |
Python 2.7.5 (default, Jun 8 2013, 12:45:21) | |
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from datetime import timedelta as t | |
>>> x = t(days=3) | |
>>> y = t(days=2) | |
>>> (x-y)*0.5 | |
Traceback (most recent call last): |
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
nmap <buffer> <silent> ]] :call search('\\c^\\<select\\>', 'W' )<CR> | |
nmap <buffer> <silent> [[ :call search('\\c^\\<select\\>', 'bW' )<CR> | |
" abbreviations | |
iab <buffer> maxdate DATE'5999-12-31' | |
iab <buffer> select SELECT | |
iab <buffer> from FROM | |
iab <buffer> and AND | |
iab <buffer> or OR | |
iab <buffer> on ON |
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
<!DOCTYPE html> | |
<!-- | |
Theme: Ashley v0.5 | |
Author: Jxnblk [http://jxnblk.com] | |
For: Tumblr [http://tumblr.com/] | |
Terms: Protected under Creative Commons. | |
--> | |
<html lang="en"> |
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
__author__ = 'U_M0AZC' | |
import random | |
import matplotlib.pyplot as plt | |
def set_choices(doors=3): | |
correct_choice = -1 | |
choices = [0 for i in range(doors)] | |
random.seed() |
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
require 'trollop' | |
class Test | |
attr_reader :a | |
attr_reader :opts | |
def initialize | |
@a = 'qwer' | |
@opts = Trollop::options do | |
opt :monkey, "Use monkey mode" # a flag --monkey, defaulting to false | |
opt :goat, "Use goat mode", :default => true # a flag --goat, defaulting to 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
def initialize | |
@root_dir = File.expand_path(File.dirname(__FILE__) + '/../') | |
@options = Trollop::options do | |
opt :asdf, | |
:type => String, | |
:default => "#{@root_dir}/qwer" | |
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
declare | |
TYPE row_nt IS TABLE OF number; | |
a row_nt; | |
cursor a_cur is | |
select level from dual connect by level <= 100; | |
n number; | |
begin |
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
import sys | |
class ProgressBar(): | |
def __init__(self, num_steps): | |
self.num_steps = num_steps | |
def progress(self, step): | |
i = int(100.0 * step / self.num_steps) |
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
', '.join(filter(lambda x: x != '', [x.strip() for x in '[email protected], , , [email protected], , '.split(',')])) |
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
'[email protected], , , [email protected], , '.split(',').map{|i| i.strip()}.find_all{|i| not i.empty?}.join(", ") |