Skip to content

Instantly share code, notes, and snippets.

View bukowa's full-sized avatar

Buk Bukowski bukowa

View GitHub Profile
@fnky
fnky / ANSI.md
Last active December 5, 2023 01:46
ANSI Escape Codes
View ANSI.md

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@klmr
klmr / Makefile
Last active October 27, 2023 23:42
Self-documenting makefiles
View Makefile
# Example makefile with some dummy rules
.PHONY: all
## Make ALL the things; this includes: building the target, testing it, and
## deploying to server.
all: test deploy
.PHONY: build
# No documentation; target will be omitted from help display
build:
@nurettin
nurettin / hst.rb
Last active November 15, 2023 18:59
metatrader 4 hst reader
View hst.rb
class Hst
attr_reader :version
attr_reader :copyright
attr_reader :symbol
attr_reader :period
attr_reader :digits
attr_reader :timesign
attr_reader :lastsync
def initialize(file)
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active December 4, 2023 06:10
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@Zearin
Zearin / python_decorator_guide.md
Last active November 30, 2023 20:57
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)
View python_decorator_guide.md

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@norman
norman / earthdistance.rb
Last active November 3, 2022 21:20
Geographic Searches With Postgres's Earthdistance and Cube Extensions
View earthdistance.rb
#!/usr/bin/env ruby
=begin
= Geographic Searches With Postgres's Earthdistance and Cube Extensions
This program shows how to easily create a Postgres database that uses the Cube
and Earthdistance extensions to perform fast queries on geographic data.
Briefly, the problem this code solves is "show me all places within 50
kilometers of New York City."
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
View proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@codysoyland
codysoyland / temporary_settings.py
Created June 21, 2011 21:47
Context manager for monkey-patching django settings (useful in unit tests)
View temporary_settings.py
# Example usage:
# with temporary_settings(CELERY_ALWAYS_EAGER=True):
# run_task.delay() # runs task with eager setting enabled.
from contextlib import contextmanager
from django.conf import settings
@contextmanager
def temporary_settings(**temp_settings):
orig_settings = {}
View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//