Skip to content

Instantly share code, notes, and snippets.

@elig0n
elig0n / dumprequest.php
Created April 19, 2024 05:50 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@elig0n
elig0n / getxkblayout.c
Created February 5, 2024 23:39 — forked from fikovnik/getxkblayout.c
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@elig0n
elig0n / open-in-firefox-nightly.sh
Last active December 16, 2023 13:31 — forked from SpotlightKid/open-in-firefox.sh
Open URL from Termux command line in Firefox Android browser
#!/bin/bash
#
# open-in-firefox-nightly.sh - open URL from Termux command line in Firefox Nightly Android browser
#
# Works with file:// URLs too, unlike with termux-open{-url}.
#
exec am start --user 0 -a android.intent.action.VIEW -n org.mozilla.fenix/.IntentReceiverActivity -d "$1" >/dev/null
//
// This program reads a sourcemap from stdin
// and replaces the "mappings" property with
// human readable content. It writes the output
// to stdout.
//
// 1. install the dependencies:
// npm i concat-stream vlq
//
// 2. optional: install jq for pretty printing json
[skin]
description=Ajnasz Blue Theme. Midnight Commander skin from Ajnasz.
[Lines]
horiz=─
vert=│
lefttop=┌
righttop=┐
leftbottom=└
rightbottom=┘
@elig0n
elig0n / chanhop.sh
Created August 4, 2020 16:12 — forked from hnw/chanhop.sh
#!/bin/bash
# Channel hopping shell script
# GPLv2
# Portions of code graciously taken from Bill Stearns defragfile
# http://www.stearns.org/defragfile/
#
# jwright@hasborg.com
# Defaults
BANDS="IEEE80211B"
@elig0n
elig0n / README-cdx.md
Created July 7, 2020 22:47 — forked from programus/README-cdx.md
Extended windows cd command

CDX Command - CD eXtension batch file

This is a batch file could help you change working directory easier especially you need to change many directories very often like me.

Features

  • Save histroy of all navigated directories
  • No duplicated directories in histroy
  • Name history directories
  • Jump into any directory in histroy by index or name
  • Quich jump into previous directory
  • Maintain history list
@elig0n
elig0n / copy-permalink.lua
Last active June 18, 2020 11:48 — forked from olejorgenb/copy-permalink.lua
mpv user script: copy a command that will resume video at current position
@elig0n
elig0n / python-run.vimrc
Created May 17, 2020 17:25 — forked from vishnubob/python-run.vimrc
Add this to your .vimrc to execute python in a new window. If your program produces no output, no windows is created.
nnoremap <silent> <leader><space> :call SaveAndExecutePython()<CR>
vnoremap <silent> <leader><space> :<C-u>call SaveAndExecutePython()<CR>
" https://stackoverflow.com/questions/18948491/running-python-code-in-vim
function! SaveAndExecutePython()
" SOURCE [reusable window]: https://github.com/fatih/vim-go/blob/master/autoload/go/ui.vim
" save and reload current file
silent execute "update | edit"
@elig0n
elig0n / myweechat.md
Created March 5, 2020 23:29 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 2.8-dev

Enable mouse

/mouse enable