Skip to content

Instantly share code, notes, and snippets.

@fghber
fghber / sample-php-headers.php
Last active October 26, 2017 16:57 — forked from ScottPhillips/sample-php-headers.php
PHP Header Examples
301 moved permanently (redirect):
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.example.com');
die();
?>
302 moved temporarily(redirect):
<?php
header('Location: http://www.example.com');
@fghber
fghber / NicePythonLibraries.md
Last active December 22, 2017 16:59
Nice Python Libraries

Data Science

Dask Dask is a flexible parallel computing library for analytic computing.

Windows

Pywinauto pywinauto is a GUI automation library written in pure Python and well developed for Windows GUI. At its simplest it allows you to send mouse and keyboard actions to dialogs and controls on both Windows and Linux.

"""
Author: Jeff Petkau
This code is in the public domain. You can run it, copy it, change
it, sell it, eat it, or claim you wrote it; I don't care.
Source: http://web.archive.org/web/20071024164712/http://www.uselesspython.com/jpetkau1.py
inverse regex:
given a regular expression string, produces random strings that
match the expression.
@fghber
fghber / README.md
Created April 17, 2018 05:17 — forked from joyrexus/README.md
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@fghber
fghber / perl-one-liners
Created April 17, 2018 06:36
Perl One-Liners
Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10
-------------------------------- ----------- ------------
Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter)
http://www.catonmat.net -- good coders code, great reuse
Latest version of this file is always at:
http://www.catonmat.net/download/perl1line.txt
use strict;
use warnings;
use YAPE::Regex::Explain;
my $regex = qr/\G([\w-]+).+?\b/;
my $xplain = YAPE::Regex::Explain->new($regex);
print $xplain->explain;
The regular expression:
@fghber
fghber / fuzzex.py
Created June 8, 2018 06:04 — forked from swdunlop/fuzzex.py
Random string generator using regex-like expressions
#!/usr/bin/env python
# Copyright (C) 2010, Scott W. Dunlop <swdunlop at gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the