Skip to content

Instantly share code, notes, and snippets.

View MattMattV's full-sized avatar
💭

Matthieu Vion MattMattV

💭
View GitHub Profile
@ijt
ijt / http_get.go
Last active August 21, 2024 05:11
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@LeonB
LeonB / serve.sh
Created July 30, 2012 21:03
One-line bash http server
:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f "$n" ]; then $e "<a href=\"/$n\">`ls -gh $n`</a><br>";fi;done););elif [ -f $f ];then $e "$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`";$e;cat $f;else $e -e "$h 404 Not Found\n\n404\n";fi)';done
@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@satreix
satreix / custom_archlinux_live_USB.md
Last active May 14, 2025 09:43
Custom Arch Linux live USB

Custom Arch Linux live USB

Setup

Install the dependencies for the archiso package:

(root): pacman -S make squashfs-tools libisoburn dosfstools patch lynx devtools git

I recommend archiso getting them from git, there is a package in the repositories, however, at this time of writing, it will not work with the instructions below. So, grab the most recent version from git and install it:

(user): git clone git://projects.archlinux.org/archiso.git && cd archiso

@eduardocardoso
eduardocardoso / gist:82a629882ddb02ab3677
Last active April 3, 2023 08:23
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@aggrolite
aggrolite / redditbot.md
Last active January 18, 2025 16:15
Writing a reddit bot with Go and OAuth2
@Heat-Miser
Heat-Miser / Bookmarklets
Last active September 14, 2016 08:46
Bookmarklets anti antiadblocks
http://lexpress.fr => javascript:$('.gam_info_s12').remove();
http://lefigaro.fr => javascript:$('.fig-article-body').css("text-shadow", "rgb(0, 0, 0) 0px 0px 0px");$('.fig-chapo').css("text-shadow", "rgb(0, 0, 0) 0px 0px 0px");$('.fig-adb').remove();
http://business.lesechos.fr/ => javascript:$('#iframe_adblock').remove();javascript:$('#p_adblock').remove();javascript:$('#chapo_adblock').remove();$('#gauche_article').css('display', 'block');$('#droite_article').css('display', 'block');
@spdustin
spdustin / README.md
Last active July 15, 2016 06:42
HN Styles

HN Styles

Just some simple CSS styles for Hacker News that I use to keep the default look and feel, but improve usability a bit.

@loisaidasam
loisaidasam / README.md
Created October 17, 2016 18:46
Your name in Japanese

Ever want to hear your name in Japanese? Now you can!

Steps (to download the mp3):

  1. Visit https://translate.google.com/#auto/ja and type in your name

  2. Click the audio icon to hear what your name sounds like in Japanese (yay!)

  3. [cmd] + [option] + j (in Chrome) to open the console, and click the Network tab.

@shanielh
shanielh / readme.md
Last active November 21, 2016 18:35
Witch!

Usage

./witch.sh terraform

Result

 _________________________________________