Skip to content

Instantly share code, notes, and snippets.

View velppa's full-sized avatar
🎯
Focusing

Pavel Popov velppa

🎯
Focusing
View GitHub Profile
@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
# 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):
@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, [])
(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 / 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.
<!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 / 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.
@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 / 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 / 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