Skip to content

Instantly share code, notes, and snippets.

View Gonzih's full-sized avatar
🤠
ATX

Maksim Soltan Gonzih

🤠
ATX
View GitHub Profile
@CAFxX
CAFxX / golang_minimize_allocations.md
Last active April 25, 2024 19:14
Minimize allocations in Go

📂 Minimize allocations in Go

A collection of tips for when you need to minimize the number of allocations in your Go programs.

Use the go profiler to identify which parts of your program are responsible for most allocations.

⚠️ Never apply these tricks blindly (i.e. without measuring the actual performance benefit/impact). Most of these tricks cause a tradeoff between reducing memory allocations and other aspects (including e.g. higher peak memory usage, higher CPU usage, lower maintainability, higher probability of introducing subtle bugs). Only apply these tricks if the tradeoff in every specfic case is globally positive.

Protobuf

@techhazard
techhazard / Readme.md
Last active January 26, 2024 16:23
NixOS: PCI Passthrough

PCI Passthrough

Warning: unfinished (but successfull!)

I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).

This is my attempt at doing the same on Nixos.

Requirements

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@cahna
cahna / ansible-aur-pkg-installer.md
Last active September 11, 2022 06:26
download, build, and install aur packages with ansible

About

When using ArchLinux, I typically prefer to use an AUR helper like pacaur or yaourt to automate away the process of installing a community package.

Ansible's pacman module is great, but it doesn't support AUR packages or pacman's -U flag. Installing AUR packages with Ansible seemed to be left as an exercise to the user, and since AUR helpers do not come with a fresh Arch install, I

@wolfeidau
wolfeidau / main.go
Created July 25, 2014 08:25
Epoll example in golang starting point
package main
//
// Starting point is from http://gcmurphy.wordpress.com/2012/11/30/using-epoll-in-go/
//
import (
"fmt"
"os"
"syscall"
@Flamefork
Flamefork / React.addons.tagHelper.js
Last active January 4, 2016 00:08
React addon for easier React.DOM building without JSX
//
// React addon for easier React.DOM building without JSX
//
// Usage:
//
// render: function () {
// return React.addons.tagHelper(
// ['#main.container',
// ['h1', 'Hello!'],
// ['a.andClass.andAnother', { href: '/' }, 'Home']]
@doitian
doitian / gitlab-hipchat.coffee
Created December 9, 2013 19:28
Send gitlab notifications through hubot API, customized color and messages comparing to the bult-in hipchat service integration in Gitlab
# Description:
# Post gitlab related events using gitlab hooks and hipchat API
#
# Dependencies:
# "url" : ""
# "querystring" : ""
#
# Configuration:
# HIPCHAT_TOKEN
# GITLAB_ROOT
@teffalump
teffalump / README.md
Last active January 4, 2023 21:17
OpenWRT adblock implementation

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark