Skip to content

Instantly share code, notes, and snippets.

View timurgen's full-sized avatar
🐷
...

Tim Sam timurgen

🐷
...
View GitHub Profile
@timurgen
timurgen / go-os-arch.md
Created November 10, 2019 08:33 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@timurgen
timurgen / pros_are_nice.md
Created May 27, 2019 09:25 — forked from morcefaster/pros_are_nice.md
Did anyone say drama?

Preface

Hello everyone. With Ceb drama getting so much traction, I decided to do what any rational person would do in this situation - download all public matches of all professional dota 2 players and then scan the all-chat for any racism or naughty naughty words, so the j͇͕͙ͣu͒͆s̼̠͍̖̮̳ͮ̃t̫̙̯͎ͬ̇̊̄iͨć̼͓ͬͨ͑ͣe͉̜̫̱̠̘̋̒ͅ can be upheld once and for all.

There are several nuances that stood in my way.

  1. Many professionals' pubs are kept private.
  2. Most of the trashtalk happens in ally chat, which isn't saved.
  3. Some of the trashtalk happens over mic... which again, isn't saved.
  4. Lots of horrible racism happens in non-English, making it hard to look for.
@timurgen
timurgen / measure-opens-and-closes.d
Created September 3, 2018 12:48 — forked from szaydel/measure-opens-and-closes.d
Dtrace snippets for observing the syscall interaction.
dtrace -qn '
/* Result is a CSV with three columns:
1) path,
2) count of open(s) without matching close(s)
3) number of times opened*/
int self fd[int];
string self path;
BEGIN {
start = timestamp;
}
@timurgen
timurgen / docker-clear.bat
Created August 27, 2018 07:13 — forked from daredude/docker-clear.bat
delete all docker container and images on windows
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i

Installing the Oracle Java 8 JDK on SmartOS

  1. Go to: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Download the "Solaris x64 XX.X MB jdk-8u66-solaris-x64.tar.gz" tarball from the Oracle Java SE site. You won't be able to paste the URL into curl on your SmartOS instance unless you click it first to get the authentication parameter. Regardless, get the tarball any way that you prefer and copy it onto your SmartOS instance.
  3. Extract the tarball and copy it to the location of your choosing.
  4. Globally set the value of the environment variable JAVA_HOME to the path of the JVM.
  5. Update your PATH to include the Java bin directory by setting it to PATH=$PATH:$JAVA_HOME/bin
@timurgen
timurgen / bootstrap.s
Created April 30, 2018 06:59 — forked from isqad/bootstrap.s
Bootstrap for stm32f103
@ stm32f103 has 0x5000 (4K) SRAM
@ SRAM is starting from 0x20000000
@ so stack is eq 0x20000000 + 0x5000 = 0x20005000
@ flash starts from 0x08000000
.syntax unified
.thumb
.cpu cortex-m3
@timurgen
timurgen / HotSpot JVM intrinsics JDK 7
Last active March 27, 2018 10:22 — forked from apangin/HotSpot JVM intrinsics
HotSpot JVM intrinsics
Intrinsic-функции в JDK 7
java.lang.Object
_hashCode java.lang.Object.hashCode()
_getClass java.lang.Object.getClass()
_clone java.lang.Object.clone()
_Object_init java.lang.Object()
@timurgen
timurgen / latency.txt
Created December 7, 2017 10:09 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@timurgen
timurgen / code-review-checklist.md
Last active February 7, 2022 13:43 — forked from nerandell/code-review-checklist.md
Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@timurgen
timurgen / composer.json
Created January 22, 2016 10:17 — forked from spekkionu/composer.json
Standalone validation using laravel validation component
{
"name": "spakkionu/validate",
"description": "Validation Test",
"require": {
"illuminate/validation": "~4.2.9"
},
"license": "MIT",
"authors": [
{
"name": "Jonathan Bernardi",