Skip to content

Instantly share code, notes, and snippets.

View arvenil's full-sized avatar
💻
Looking for project

Kamil Dziedzic arvenil

💻
Looking for project
View GitHub Profile
@sorenvonsarvort
sorenvonsarvort / golang-1.13-will-support-generics.md
Last active March 28, 2021 15:43
golang-1.13-will-support-generics

Golang 1.13 Will Support Generics

Every developer knows generics support is the most wanted feature in any major programming language. A few months ago Rob Pike had already approved several Golang proposals, one of them included the new generics feature. This decision is made not only for engaging more developers to the community, but also for boosting existing projects and scaling their codebases.

https://go.googlesource.com/proposal/+/master/design/go2draft-contracts.md

According to it the generics in Golang are based on the contracts and have a pretty familiar syntax. Here are some examples:

@codemedic
codemedic / kinesis-get-records.sh
Last active May 29, 2023 15:40
Get records from a AWS Kinesis Data Stream. It allows you to start iterating from a time in the past.
#!/usr/bin/env bash
if ! aws_bin="$(which aws)" 2>/dev/null; then
echo "aws cli is missing; you can get it from https://aws.amazon.com/cli/"
exit 1
fi
if ! jq_bin="$(which jq)" 2>/dev/null; then
echo "jq is missing; you can get it from https://stedolan.github.io/jq/"
exit 1
@mattmc3
mattmc3 / modern_sql_style_guide.md
Last active April 27, 2024 00:11
Modern SQL Style Guide
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@nickcarenza
nickcarenza / mycnf.go
Created January 30, 2017 22:31
Golang read connection details from my.cnf
package db
// stdlib
import (
"fmt"
"os"
)
// external
import (
@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@arvenil
arvenil / vercmps.sh
Last active August 29, 2015 14:04 — forked from livibetter/vercmp.sh
Fix for "08: value too great for base", works for versions with numbers only (no letters, no rc suffixes)
#!/bin/bash
# Copyright (c) 2012 Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
@lexrus
lexrus / disable_all_animation.sh
Created August 1, 2014 06:05
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
@samsalisbury
samsalisbury / .gitconfig
Last active June 22, 2022 19:30
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@cowboy
cowboy / bad-bad-bad.js
Created October 15, 2011 14:44
Shitty destructors for JavaScript!
function Thing(context, name) {
this.context = context;
this.name = name;
this.init();
this.startTheWorstGarbageCollectorEver();
}
Thing.prototype.startTheWorstGarbageCollectorEver = function() {
var id = setInterval(function() {
if (!this.context[this.name]) {