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)
package main | |
import "fmt" | |
func main() { | |
var z []int | |
z2 = []int{} | |
fmt.Println(z == nil) // prints true | |
fmt.Println(z2 == nil) // prints false | |
} |
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' |
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)
#!/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 |
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/) |
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 =~ /\/$/ |
class Overriden | |
class << self | |
def a | |
'GLOBAL' | |
end | |
end | |
end | |
module A | |
class Overriden |
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 |