Skip to content

Instantly share code, notes, and snippets.

🚩
KubeCon mode, expect no reviews until 5/25

Ahmet Alp Balkan ahmetb

Block or report user

Report or block ahmetb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tiborvass
tiborvass / main.go
Last active Aug 29, 2015
Hijacking Standard streams for Windows ANSI Emulation
View main.go
package main
func Main() {
// everything that is currently in our main()
}
@ahmetb
ahmetb / Retry.cs
Last active Aug 29, 2015
Retry logic modified for our testing needs, see comments at the end
View Retry.cs
using System;
using System.Diagnostics;
using System.Threading.Tasks;
public class RetryLoop<TResult>
{
public RetryLoop(Func<RetryIterationContext<TResult>, Task<TResult>> func, Func<RetryIterationContext<TResult>, bool> succeeded)
{
this.func = func;
this.timer = new Stopwatch();
@nathanwdavis
nathanwdavis / partitioned_loops.go
Last active Dec 21, 2015
Messing around with really CPU intensive math ops and comparing simple for loops vs. goroutine per loop vs. partitioning into multiple goroutines (lightweight, green threads) in Go. The range partitioned goroutine-based solution tends to run around 3.5 - 4x faster than the simple for loop using 8 goroutines. The one that uses a goroutine per loo…
View partitioned_loops.go
/*
Example Output:
➜ go run partitioned_loops.go
Starting...
simpleFor result: 468767562500, time: 0.013604745000000001 sec
goForEach result: 468767562500, time: 24.106190332 sec
goPartitioned result: 468767562500, time: 0.004296383 sec
*/
package main
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
@tanaydin
tanaydin / LICENSE.txt
Created Jun 4, 2011 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Kilian
Kilian / annoying.js
Created Jan 6, 2011
How to be an asshole
View annoying.js
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
You can’t perform that action at this time.