Skip to content

Instantly share code, notes, and snippets.

View markuman's full-sized avatar
🐧
Linux Only - fail fast, move on

Markus Bergholz markuman

🐧
Linux Only - fail fast, move on
  • Lekker Energie GmbH
  • Berlin
View GitHub Profile
@mallendeo
mallendeo / toutf8.ts
Last active February 27, 2023 22:29
Convert iso-8859-1 to utf-8 in nodejs
import iconv from 'iconv'
export const convertToUTF8 = <T extends any>(body: T, fromEncoding = 'iso-8859-1'): T => {
const ic = new iconv.Iconv(fromEncoding, 'utf-8')
const buf = ic.convert(JSON.stringify(body))
return JSON.parse(buf.toString('utf-8'))
}
@inmatarian
inmatarian / lzw.lua
Created December 27, 2014 02:14
LZW Compression in Lua, rosetta-code style, also includes a 8-bit only mode for 7bit plain text strings.
local lzw = {}
local function enc_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end
for i = 0, size-1 do dict[string.char(i)] = i end
return dict
end
local function dec_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end
@aaronhurt
aaronhurt / curltest.c
Last active August 24, 2025 12:09
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* License:
*
* This code is licensed under MIT license
* https://opensource.org/licenses/MIT
*
@fur-q
fur-q / Makefile
Last active August 29, 2015 14:06
im da bes
CC = gcc
LUA = luajit
loader: loader.o myscript.l.o
$(CC) $(LDFLAGS) -o $@ $^
%.l.o: %.lua
$(LUA) -bg $^ $@
local currentval = redis.call('get', ARGV[1])
local currentcount = redis.call('get', ARGV[1] .. '.count')
redis.call('incr', ARGV[1] .. '.count')
currentval = (currentval * (currentcount/(currentcount + 1))) + (ARGV[2]/(currentcount+1))
redis.call('set', ARGV[1], currentval)
return currentval
@upa
upa / LICENSE
Last active August 23, 2022 16:42
Ansible Module for Linux Bridge and VLAN
MIT License
Copyright (c) 2021 Ryo Nakamura
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:
@akesterson
akesterson / gist:11391984
Created April 29, 2014 06:22
Why I switched from bamboo to jenkins
TL;DR - It was proving to be more buildsystem than I needed,
and I had found that there were other buildsystems that met my needs
that I felt were lighter and more nimble. It's still a fine product
that I continue to recommend to this day, I just no longer see it as
"The One True Way".
=========================
1: Bamboo was consuming a significant amount of system resources,
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
anonymous
anonymous / PKGBUILD
Created March 4, 2014 15:36
wxlua 2.8.12.3 PKGBUILD (lua 5.2)
# Maintainer : speps <speps at aur dot archlinux dot org>
# Contributor: Eric Forgeot < http://ifiction.free.fr >
pkgname=wxlua
pkgver=2.8.12.3
pkgrel=1
pkgdesc="A set of bindings to the wxWidgets library for the Lua programming language."
arch=('i686' 'x86_64')
url="http://wxlua.sourceforge.net"
license=('custom:wxWindows')
@denji
denji / http-benchmark.md
Last active May 4, 2026 04:06
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)