Skip to content

Instantly share code, notes, and snippets.

View Xe's full-sized avatar
😂
h

Xe Iaso Xe

😂
h
View GitHub Profile
@chrismcfee
chrismcfee / Entire Guide
Last active March 1, 2024 06:43
May the Force be with You: A tulpa creation guide by Methos
May the Force be with You
A Tulpa Creation Guide
by Methos
Twitter: @GGMethos
ggmethos@autistici.org
v2.8.1
Last Edit: 28-Sep-2017
The following work falls under the Creative Commons Attribution 4.0 International (CC BY 4.0) License. The official terms of the license can be seen here:
@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

Displaying images in the terminal with tput and echo

output

Requires ImageMagick, easily available from your favorite package manager. Tested on Linux and OSX
convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n "  ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@jsound
jsound / GarbageOnly_GarbageProducer
Created December 23, 2013 13:38
A simple GC micro benchmark that creates only objects of 0 lifetime (but as many of them as possible)
package de.am.gc.benchmarks;
/**
* A GC micro benchmark running a given number of threads that create objects of a given size and dereference them immediately
*
* @author jsound
*/
public class GarbageOnly {
// object size in bytes
private static final int DEFAULT_NUMBEROFTHREADS=8;
@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active April 29, 2024 09:09
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@andyshinn
andyshinn / DEISGCE.md
Last active June 7, 2020 19:17
Deis in Google Compute Engine

Deis in Google Compute Engine

Let's build a Deis cluster in Google's Compute Engine!

Google

Get a few Google things squared away so we can provison VM instances.

Google Cloud SDK

@Eltiech
Eltiech / .mancolor.sh
Last active September 9, 2023 12:11
Procedurally generated man pages; each man page gets its own color scheme.
#Author: Malsententia <Malsententia@gmail.com>
#Purpose: Colorized man pages, with random themes seeded by
# the command and/or section. That is, every man page
# has its own consistent color scheme. For example
# man tar is always yellow, green, and blue, man less
# is always pink, blue, and yellow, etc.(on zsh, anyway)
#Note: Colorization will differ between bash and zsh, since their
# RNGs are different
#Requires: bash or zsh(may support others), and perl
#Setup: Name it .mancolor.sh, source it in your bashrc/zshrc,
@acous
acous / dark-compact.css
Last active March 28, 2016 19:15
early dark theme for Shout irc
body {
background: #333;
color: #CCC;
font: 16px Lato, sans-serif;
margin: 0;
}
#main {
background: #222;
border-radius: 0px;
bottom: 0px;
@omeid
omeid / express.go
Last active August 29, 2015 14:09
Node.js (Express) Style Go Middleware in 40 line of code.
package main
import (
"log"
"net/http"
"time"
)
type Handler func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)