Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@willurd
willurd / web-servers.md
Last active November 10, 2025 16:13
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mjdominus
mjdominus / with-memory-limit
Created April 11, 2013 02:22
with-memory-limit utility program
!/usr/bin/perl
use BSD::Resource qw(setrlimit RLIMIT_VMEM RLIM_INFINITY);
my ($mem) = shift // usage();
@ARGV or usage();
my ($n, $s) = $mem =~ /\A (\d+) ([kmgKMG]?) \z/x or usage();
my $suf = { k => 1024,
m => 1024 * 1024,
g => 1024 * 1024 * 1024,
};
@mislav
mislav / _readme.md
Last active July 22, 2025 23:54
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@creaktive
creaktive / TerminusBold.dfont
Last active January 6, 2019 13:09
Terminus Powerline for Mac OS X
@creaktive
creaktive / sort.pl
Last active December 12, 2015 08:49
Created by www.tryperl.com.
#!/usr/bin/env perl
use strict;
use warnings qw(all);
#use List::Util qw(shuffle);
# Fisher-Yates shuffle
sub shuffle (@) {
for my $i (reverse 1 .. $#_) {
my $j = int rand $i + 1;
@_[$i => $j] = @_[$j => $i];
@creaktive
creaktive / yada-crawler.pl
Last active May 7, 2021 10:24
Simple web crawler/scraper implemented using Web::Scraper & YADA
#!/usr/bin/env perl
use 5.016;
use common::sense;
use utf8::all;
# Use fast binary libraries
use EV;
use Web::Scraper::LibXML;
use YADA 0.039;
@lebedov
lebedov / freq_shift_ssb.py
Last active April 10, 2023 20:37
Frequency shift a signal using SSB modulation.
#!/usr/bin/env python
"""
Frequency shift a signal using SSB modulation.
"""
import numpy as np
import scipy as sp
import scipy.signal
import matplotlib.pyplot as plt
@creaktive
creaktive / mojo-crawler.pl
Last active November 28, 2020 13:15
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@banaslee
banaslee / XGH - de-de.txt
Last active September 23, 2025 08:25
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Quelle: http://gohorseprocess.wordpress.com
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f
1. Ich denke, also ist es nicht XGH.
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller.
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller.
@creaktive
creaktive / oneliners.sh
Created November 14, 2012 18:11
useful (?) Perl oneliners
# used modules (to be piped to cpanm)
ack --perl --output '$1' -h '^use\s+([\w:]+)' ~/libwww-perl-6.04/ | sort -u
# flattern sitemap (to be piped to yada)
perl -Mojo -le 'g($ARGV[0])->dom->find("loc")->each(sub{print shift->content_xml})' http://g1.globo.com/sitemap.xml