Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
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 https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz /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
AnatoliiD / namespacing.rb
Created Oct 14, 2016
Namespacing and reusage of overriden classes.
View namespacing.rb
class Overriden
class << self
def a
'GLOBAL'
end
end
end
module A
class Overriden
@AnatoliiD
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'
GC.disable
Benchmark.ips do |bm|
bm.report '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: http://lit-coast-9918.herokuapp.com/react12/index.html
6) Focus on just one customer type and just one problem (KISS)
7) Engage 100 journalists 2 months before you launch (muck rack / pressfriendly.com 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 http://django-compressor.readthedocs.org/en/latest/)
@AnatoliiD
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'
'result'
end
def block_method
puts 'I was called only once'
'result'
end
@AnatoliiD
AnatoliiD / _service.md
Last active Jan 5, 2016 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@AnatoliiD
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'
end
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.