Skip to content

Instantly share code, notes, and snippets.

View ilius's full-sized avatar

Saeed Rasooli ilius

  • Iran
  • 04:31 (UTC +03:30)
View GitHub Profile
@ddelange
ddelange / Installing PyICU, libpostal, pypostal on Mac OS X 10.14+.md
Last active October 13, 2023 17:59
Installation instructions for libicu-dev, PyICU, libpostal, pypostal on Mac OS X 10.14+

Installing PyICU, libpostal, pypostal on Mac OS X 10.14+

libicu-dev (PyICU dependency)

brew uninstall --ignore-dependencies icu4c
brew install pkg-config icu4c  # keg-only
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 9, 2024 18:54
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

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

GOOS Values

GOOS Out of the Box
aix
android
@hristian-carabulea
hristian-carabulea / Guide.md
Last active March 14, 2018 07:11 — forked from dpaluy/Guide.md
A Guide to Software Developer Job Advertisements
Job Description Actual meaning
A fast-paced environment Your job will be constant firefighting
A market leader Recently started making a profit
Able to work with minimal spervision You'll be the one we blame when something goes wrong
An Agile team We have daily stand-ups
Dynamic environment Our leadership keeps changing priorities
Must be a team player Must not question authority
Ninja You do all the work alone
Passionate You wil
@mlocati
mlocati / main.c
Last active January 19, 2024 14:10
Enable/disable/check color support for Windows (ENABLE_VIRTUAL_TERMINAL_PROCESSING flag)
#define _WIN32_WINNT 0x0600
#include <stdio.h>
#include <windows.h>
#include <fileapi.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
@dpaluy
dpaluy / Guide.md
Last active March 14, 2018 07:10
A Guide to Software developer job advertisements
Job Description Actual meaning
a fast-paced environment Your job will be constant firefighting
must be a team player Must not question authority
able to work with minimal spervision You'll be the one we blame when something goes wrong
an Agile team We have daily stand-ups
a market leader Recently started making a profit
rockstar developer You will work very long hours with impossible deadlines
ninja You do all the job along
we have an urgent need Our other rockstar just left and no one underst
@bobbruno
bobbruno / bufferise.py
Created November 10, 2015 00:16
python decorator for bufferising generator output
def bufferise(defbuf=20, defskip=0):
def decorate(function):
def wrapper(*args, **kwargs):
bufsize = kwargs['bufsize'] if 'bufsize' in kwargs else defbuf
skiplines = kwargs['skiplines'] if 'skiplines' in kwargs else defskip
print 'Bufsize = {}'.format(bufsize)
print 'Skip {} lines'.format(skiplines)
if skiplines:
for i, record in enumerate(function(*args, **kwargs), start=1):
if i > skiplines:
@ilius
ilius / psql_mem_tuner.py
Last active March 7, 2024 06:20
PostgreSQL Memory Tuner
total_memory_percentage = 20.0
total_memory_max_megabytes = 8000
memory_params_percentage = {
'shared_buffers': 25.0,
'work_mem': 1.0,
'maintenance_work_mem': 12.0,
'effective_cache_size': 62.0,
}
@everbeen
everbeen / benchmark.go
Last active November 14, 2023 22:17
BSON vs. Gob vs. MessagePack encoding & decoding benchmark
package main
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/ugorji/go/codec"
"io/ioutil"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
@lwalen
lwalen / git-blame-colored
Created October 31, 2013 00:08
A fancy git blame. Presents code with initials of author to the left. Colors author's names and initials for easy blaming.
#!/usr/bin/env ruby
# Colorize string
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
end
class Colors