Skip to content

Instantly share code, notes, and snippets.

View .vimrc
source ~/.vim/vimrc
" Auto save when focus lost and ignore warnings from untitled buffers
:au FocusLost * silent! :wa
" Save on buffer switch
:set autowriteall
set runtimepath+=~/.vim/vim-objj
au BufNewFile,BufRead *.j,Jakefile setf objj
" au! BufRead,BufNewFile *.json set filetype=json
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufNewFile,BufRead *.prawn set ft=ruby
View 1.sql
"Limit (cost=7462.23..7462.26 rows=10 width=404) (actual time=174.219..174.221 rows=10 loops=1)"
" -> Sort (cost=7462.23..7588.10 rows=50345 width=404) (actual time=174.218..174.219 rows=10 loops=1)"
" Sort Key: (count(loans.*))"
" Sort Method: top-N heapsort Memory: 27kB"
" -> GroupAggregate (cost=0.00..6374.30 rows=50345 width=404) (actual time=0.036..153.099 rows=50285 loops=1)"
" -> Merge Left Join (cost=0.00..5610.68 rows=52033 width=404) (actual time=0.019..106.530 rows=52034 loops=1)"
" Merge Cond: (users.id = loans.user_id)"
" -> Index Scan using users_pkey on users (cost=0.00..2486.07 rows=50345 width=97) (actual time=0.008..26.936 rows=50285 loops=1)"
" -> Index Scan using index_loans_on_user_id on loans (cost=0.00..2348.34 rows=52033 width=311) (actual time=0.007..30.102 rows=52034 loops=1)"
"Total runtime: 174.269 ms"
View test.rb
class A
@@dir_name = nil
def self.dir_name
@@dir_name
end
end
class B < A
@@dir_name = "B"
end
View oversun Moscow 188.127.234.52
houdini: /mili/mili2 > traceroute 188.127.234.52
traceroute to 188.127.234.52 (188.127.234.52), 64 hops max, 52 byte packets
1 192.168.4.1 (192.168.4.1) 14.121 ms 2.905 ms 3.370 ms
2 gw.corbina.net (85.21.215.69) 2.475 ms 2.537 ms 5.381 ms
3 bdmitr7-5s3-me2-vl90.corbina.net (195.14.61.57) 4.971 ms 2.357 ms 5.912 ms
4 lu-bb-vlan96.msk.corbina.net (85.21.226.46) 20.584 ms 4.797 ms 10.359 ms
5 dolg-bb-tengige0-1-0-3.corbina.net (195.14.54.108) 4.839 ms 3.624 ms 5.660 ms
6 m10-bb-po2.corbina.net (195.14.54.154) 4.418 ms 2.287 ms 2.091 ms
7 comcor-mmts10.msk.corbina.net (195.14.32.38) 13.067 ms 7.357 ms 4.110 ms
8 iki-crs.comcor.ru (62.117.100.73) 6.100 ms 4.308 ms 7.592 ms
View mkmf.log
houdini@houdini-bizon:~/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/pg-0.17.1$ cat mkmf.log
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -o conftest -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/x86_64-linux -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby/backward -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0 -I. -I/usr/local/pgsql/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/houdini/.rvm/rubies/ruby-2.1.5/lib -Wl,-R/home/houdini/.rvm/rubies/ruby-2.1.5/lib -L/usr/local/pgsql/lib -Wl,-R/usr/local/pgsql/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-rpath,'/../lib' -Wl,-R -Wl,'/../lib' -L'/../lib' -lruby -lpthread -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h
View output
lua test.lua
lua: test.lua:5: attempt to index a nil value (global 'zstring')
stack traceback:
test.lua:5: in main chunk
[C]: in ?
View sbt-web.error.log
houdini@houdini-XPS:~/codes/sbt-web$ sbt
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[info] Loading project definition from /home/houdini/codes/sbt-web/project
Missing bintray credentials /home/houdini/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to sbt-web (in build file:/home/houdini/codes/sbt-web/)
> publishLocal
[warn] Credentials file /home/houdini/.bintray/.credentials does not exist
[info] Main Scala API documentation to /home/houdini/codes/sbt-web/target/scala-2.11/sbt-0.13/api...
[info] Compiling 11 Scala sources to /home/houdini/codes/sbt-web/target/scala-2.11/sbt-0.13/classes...
[info] :: delivering :: com.typesafe.sbt#sbt-web;1.2.1-SNAPSHOT :: 1.2.1-SNAPSHOT :: integration :: Sun May 24 04:03:59 MSK 2015
View ssl_client.scala
object SslClient {
val jks_file_name = "jks_2015.store"
// Crypto initializer
val keyManagerFactory = KeyManagerFactory.getInstance("SunX509")
val trustManagerFactory = TrustManagerFactory.getInstance("SunX509")
val keyStore = KeyStore.getInstance("JKS")
val trustKeyStore = KeyStore.getInstance("JKS")
View Степень перекрытия множеств.py
import pylab
from math import exp
def scatter_plot(x, y, r, color='b'):
for i in range(len(x)):
pylab.scatter(x[i], y[i], s=r, c=color)
#x1 = [0, 1., 0.1, 2, 3, 2.3, 3.1, 1.7, 1.9]
#y1 = [0.1, 0.2, 0.8, 1, 1.5, 1.9, 2.1, 1.7, 1.9]
View gist:344293
# Simple generic algorithm
# Authors: Valeriya Guseva and Dmitrii Golub
# Date: March 2010
import numpy
import pylab
from math import *
from random import randint, random
# Constants