Skip to content

Instantly share code, notes, and snippets.

View velppa's full-sized avatar
🎯
Focusing

Pavel Popov velppa

🎯
Focusing
View GitHub Profile
SQL> with s as (
select 1 a, 10 b from dual union all
select 20 a, 30 b from dual union all
select 30 a, 40 b from dual union all
select 50 a, 60 b from dual union all
select 55 a, 57 b from dual union all
select 65 a, 75 b from dual union all
select 70 a, 80 b from dual union all
select 75 a, 85 b from dual
)
@velppa
velppa / install-tmux
Last active August 27, 2015 05:40 — forked from rothgar/install-tmux
Install tmux 2.0 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@velppa
velppa / pl-sql.md
Last active August 29, 2015 14:23
PL/SQL notes

PL-SQL Notes

Triggers

  • The trigger body is a PL/SQL block in which you can issue both SQL and PL/SQL statements from the trigger body. You can also call a stored procedure or a Java procedure from the trigger body. You can also invoce a procedure developed using object-oriented languages, such as C.

  • USER_PROCEDURES and USER_OBJECTS views - object status is in USER_OBJECTS

@velppa
velppa / exercise-equivalent-binary-trees.go
Last active August 29, 2015 14:23
Solutions for Go Tour
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
func walk(t *tree.Tree, ch chan int) {
if t.Left != nil {
walk(t.Left, ch)
@velppa
velppa / problem4.go
Last active August 29, 2015 14:20
Problems of blog.svpino.com
package main
import "fmt"
import "strconv"
import "math"
//maxInt takes []int and returns maximum integer stacking
//them in any order
func maxInt(nums []int) int {
if len(nums) == 0 {
@velppa
velppa / gist:93a123a3a985090d254d
Last active August 29, 2015 14:05
Bitcoin and me (Hal Finney)
I thought I'd write about the last four years, an eventful time for Bitcoin and
me.
For those who don't know me, I'm Hal Finney. I got my start in crypto working on
an early version of PGP, working closely with Phil Zimmermann. When Phil decided
to start PGP Corporation, I was one of the first hires. I would work on PGP
until my retirement. At the same time, I got involved with the Cypherpunks. I
ran the first cryptographically based anonymous remailer, among other
activities.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Notebook</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@velppa
velppa / ledger.ipynb
Created August 5, 2014 06:15
IPython notebook to compare multiple period in Ledger
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(ns ledger-reports.core
(:gen-class))
(require '[clojure.data.csv :as csv]
'[clojure.java.io :as io])
(defn read-csv
[filename]
(def csv
@velppa
velppa / 3.hs
Last active August 29, 2015 13:58
Project Euler solutions
-- take step in eratosphen cell by removing all multipliers of x in xs
ec_step :: Integer -> [Integer] -> [Integer]
ec_step 1 xs = xs
ec_step x xs = [ j | j <- xs, mod j x /= 0 ]
-- eratosphen cell recursive
ec_recc :: ([Integer], [Integer]) -> ([Integer], [Integer])
ec_recc (ps, []) = (ps, [])