Skip to content

Instantly share code, notes, and snippets.

View e1himself's full-sized avatar
🇺🇦

Ivan Voskoboinyk e1himself

🇺🇦
View GitHub Profile
for file in `ls`; \
mv $file "`exiftool -d '%Y-%m-%d %H.%M.%S' -CreateDate $file | cut -d':' -f2,3,4,5,6,7 | cut -d' ' -f2,3`.jpg"
@e1himself
e1himself / BlockNesting.md
Last active August 29, 2015 14:04
SirTrevor block nesting

Nesting

Blocks

So I've created a TabsContainer block, which allows to nest other blocks inside it. I've used the same mechanics as reused code of Columns block does for its columns. It is indended to create Tabs only inside TabsContainer.

package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
@e1himself
e1himself / exercize-equivalent-binary-trees.go
Created January 31, 2015 21:16
Tour of Go: Exercise: Equivalent Binary Trees
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
// Walk walks the tree t sending all values (sorted ascending)
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
@e1himself
e1himself / array_to_csv.php
Created April 27, 2015 09:24
Download CSV Table
<?php
/**
* Convert PHP array to CSV.
* First line keys are used as column names.
*
* [
* ['ID' => 1, 'Name' => 'John'],
* ['ID' => 2, 'Name' => 'Jane'],
* ]
@e1himself
e1himself / HackedHeaderFactory.php
Last active October 24, 2016 00:54
SwiftMailer hack: RFC 6531 (SMTP Extension for Internationalized Email)
<?php namespace App\Mailer\Swift\Mime;
use Swift_Encoder;
use Swift_Mime_Grammar;
use Swift_Mime_Header;
use Swift_Mime_HeaderEncoder;
use Swift_Mime_SimpleHeaderFactory;
/**
* Hack SwiftMailer SimpleHeaderFactory to support RFC 6531
@e1himself
e1himself / gifify
Created August 4, 2017 08:27
gifify
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: gifify INPUT OUTPUT"
exit 1
fi
ffmpeg -i "$1" -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 - "$2"