Skip to content

Instantly share code, notes, and snippets.

View mimi1vx's full-sized avatar

Ondřej Súkup mimi1vx

View GitHub Profile
@honzajavorek
honzajavorek / pyvo.py
Created April 16, 2012 19:48
Jednoduchý FB group Pyonieri -> @naPyVo bot splácaný za hodinu na koleně
#!/usr/bin/python
# -*- coding: utf-8 -*-
import imaplib
import re
import base64
import quopri
import urllib
import redis
@jboner
jboner / latency.txt
Last active May 21, 2024 18:29
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

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

@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

Setup your own win64 version of the Haskell Platform

Things you need to have

  • MSYS
  • GHC 7.8.2 win64 build
  • Cabal 1.20 win build
  • FreeGlut
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

background (46, 46, 46)
comment grey (121, 121, 121)
white (214, 214, 214)
yellow (229, 181, 103)
green (180, 210, 115)
orange (232, 125, 62)
purple (158, 134, 200)
pink (176, 82, 121)
blue (108, 153, 187)
@joshbode
joshbode / LICENSE.md
Last active April 5, 2024 14:52
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

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:

find . | grep '\.py' | grep -v -e '/venv/' -e '(' -e ')' | xargs -I % grep import % | sed -e 's/^[ ]*//' | grep -e '^from ' -e '^import ' | awk '{print $2}' | sed -e 's/^[\.]*//' | cut -d\. -f1 | tr '[A-Z]' '[a-z]' | sort -bfd | uniq -c | sort -nr | head -20