Skip to content

Instantly share code, notes, and snippets.

View rndD's full-sized avatar
🍎

Alexey Kalmakov rndD

🍎
  • Clickhouse
  • Berlin
View GitHub Profile
#!/bin/bash
set -e
FROM=/home/media/Downloads/complete
TO=/home/media/Video
for file in $FROM/*; do
echo "Where move file :$file"
select item in Shows Films Skip; do
case "$item" in
@rndD
rndD / parent_helper.html
Created February 15, 2015 11:38
parenthelper meteor example
{{deck}}
{{#each cards}}
{{#each brothers}}
{{> tmpl bro=this card=parentHelper deck=parentHelper.parentHelper.deck}}
{{/each}}
{{/each}}
@rndD
rndD / go_binary_tree_ex
Created January 6, 2015 06:37
A tour of go: Exercise: Equivalent Binary Trees
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
"reflect"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
@rndD
rndD / go_image_ex
Created December 28, 2014 17:08
A tour of GO: Exercise: Images
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type Image struct{}
@rndD
rndD / go_http_ex
Created December 28, 2014 16:16
A tour of GO: Exercise: HTTP Handlers
package main
import (
"fmt"
"log"
"net/http"
)
type String string
@rndD
rndD / go_reader_ex.go
Last active September 24, 2023 17:09
A tour of Go: Exercise: Readers
package main
import "code.google.com/p/go-tour/reader"
type MyReader struct{}
func (r MyReader) Read(bytes []byte) (int, error) {
for i := range bytes {
bytes[i] = 65
@rndD
rndD / go_fib_ex
Created December 26, 2014 03:47
Go lang Exercise: Exercise: Fibonacci closure
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
x, y := 0, 1
return func() int {
new := x + y
@rndD
rndD / go_slice_ex
Created December 26, 2014 02:47
Go lang Exercise: Slices
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
slice := make([][]uint8, dy)
for iy := range slice {
slice[iy] = make([]uint8, dx)
for ix := range slice {
@rndD
rndD / go_for_ex
Created December 25, 2014 19:19
Exercise: Loops and Functions in go tour
package main
import (
"fmt"
"math"
)
const MAX_DELTA = 0.01
func isEnough(d float64) bool {
@rndD
rndD / deep_dict.py
Last active August 29, 2015 14:06
deep dict class
# -*- coding: utf-8 -*-
class deep_dict(dict):
def __init__(self, value=None):
if isinstance(value, dict):
for key in value:
self.__setitem__(
key,
deep_dict(value[key]) if isinstance(value[key], dict) else value[key]
)
else: