Skip to content

Instantly share code, notes, and snippets.

Working from home

Anatolii Didukh AnatoliiD

Working from home
  • Ukraine, Odessa
View GitHub Profile
View go_multi_prod_upx.dockerfile
FROM golang:1.8.5-jessie as builder
# install xz
RUN apt-get update && apt-get install -y \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# install UPX
ADD /usr/local
RUN xz -d -c /usr/local/upx-3.94-amd64_linux.tar.xz | \
tar -xOf - upx-3.94-amd64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
AnatoliiD / namespacing.rb
Created Oct 14, 2016
Namespacing and reusage of overriden classes.
View namespacing.rb
class Overriden
class << self
def a
module A
class Overriden
AnatoliiD / last_slash_check_benchmark.rb
Last active Jun 6, 2016
Path last slash check benchmark
View last_slash_check_benchmark.rb
require 'benchmark/ips'
true_path = '/my_mega_true_path/'
false_path = '/my_mega_false_path'
Benchmark.ips do |bm| 'regexp match true' do
true_path =~ /\/$/
View Another Failed Startup Lessons Learned in the B2C Space
1) Start by solving a problem with a well-defined customer first
2) Don't rebuild what already exists
3) Don't spend time budget-gaming ec2 instance types
4) Publish a site that allows signups immediately (before anything else gets built)
5) Buy a simple web app package that bundles a ton of pages for example:
6) Focus on just one customer type and just one problem (KISS)
7) Engage 100 journalists 2 months before you launch (muck rack / and or pay someone to do it). Figure out and pitch the story to them before you reach out to them.
8) Use fiverr and pay a bunch of bloggers/copywriters to publish and blog a ton of stuff and budget it for at least 6 months
9) Start using adroll sooner
10) Minify and compress your javascript (I used
AnatoliiD / example.rb
Created Feb 19, 2016
understanding Hash#fetch
View example.rb
#!/usr/bin/env ruby
def param_method
puts 'I was called both times'
def block_method
puts 'I was called only once'
AnatoliiD /
Last active Jan 5, 2016 — forked from naholyr/
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
AnatoliiD / yield.rb
Last active Oct 22, 2015
yield duplications
View yield.rb
class Before
class << self
def method1
puts 'first duplication'
puts 'i am uniq for method 1'
puts 'second duplication'
def method2
puts 'first duplication'
puts 'i am uniq for method 2'
View not_wat.go
package main
import "fmt"
func main() {
var z []int
z2 = []int{}
fmt.Println(z == nil) // prints true
fmt.Println(z2 == nil) // prints false
You can’t perform that action at this time.