Skip to content

Instantly share code, notes, and snippets.

@myano
myano / gist:7435249
Last active December 28, 2015 03:29

This demonstrates how different regular expression engines handle catastrophic expressions. Python's "re" module doesn't seem to have any type of backtracking timeout.

awk

awk 4.0.1

» awk --version
GNU Awk 4.0.1

» time echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | awk '{ gsub("^(([a-z])+.)+A-Z+$", "test"); print}'

@myano
myano / goo.gl.py
Created November 13, 2013 21:05 — forked from ikks/goo.gl.py
#Given to the public domain
#No warranties
import urllib2
import simplejson
def shorturl(urltoshorten):
"""Compress the URL using goo.gl take a look at https://developers.google.com/url-shortener/v1/getting_started
>>> shorturl('http://igor.tamarapatino.org')
'http://goo.gl/FxHOn'

Python 101

Introduction

Welcome to Python 101 at PyOhio 2013!

Python 2.x or Python 3.x?

@myano
myano / AAAAAA.py
Last active December 27, 2016 12:55
Python script to check for latest episodes of television shows from tpb. Please use responsibility. Code not the cleanest nor most efficient. Improvements to come.
#!/usr/bin/env python
"""
AAAAAA.py
This script, when placed in a folder with other episodes, will find the next
episode number and query thepiratebay for the infohash of the most popular
match.
This script is only used to find shows that are freely available.
I personally enjoy Pioneer One and a bunch more films provided freely over at
@mniip
mniip / timer.c
Last active December 31, 2016 05:04
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <signal.h>
#include <curses.h>
void quit()
{
endwin();

Recommended Firefox Addons

Updated: 2017-08-10 NO LONGER MAINTAINED

These are some addons I recommend for use in Firefox to make your browsing more secure and privacy-focused. The addons link titles that are in bold are what I consider to be "must-haves" and the ones without bolded title links should be considered optional.

The "easiness" ranking ranks the extensions on how "easy" it is to install and set up. It starts at 5 being the most easy and then decreases down to 1 in "easiness". 5 means you can use the addon without any configuring (it "just works" out of the box). 4 may require some configuring to enable some main features. 3 requires several options changed to utilize its features. 2 requires some technical knowledge on what the addon actually does and what implications come from changing various settings, these kind of addons might take some set up. 1 would take considerable knowledge on what a web browser does when a website is loaded in order to

@myano
myano / recommended_addons.md
Last active August 10, 2017 16:09
Recommended Browser Addons/Extensions
@rduplain
rduplain / slides.md
Last active February 7, 2019 15:40
Use Werkzeug's web-based interactive debugger with Tornado.

Interactive Debugging in any Python Web Project

Ron DuPlain - PyOhio 2013

Turn this:

@sbp
sbp / project.bash
Created December 20, 2011 17:05
Mirror a user's gists
#!/bin/sh
GIST_USER=sbp
function usage() {
echo Usage: $0 [command], where command is one of:
echo update - Gets any new gists for user
echo pull - Keep existing gists synced with server
echo sync - Do an update then a pull
}
@myano
myano / index.md
Last active August 25, 2021 11:56
Merging forked gists into your gist to preserve the history of the gist.

Merging A Forked Gist Into Your Gist

Let's say you have a gist (public or private) and someone forks it and makes changes to it. Awesome! However, now you want to merge in their changes to your gist. Unfortunately, it doesn't seem GitHub supports this via their website at the moment, however, you can still merge the gists with 'git' on the command line.

  1. You want to clone your gist. You can locate the link for this under "Clone this gist"

     ➜  ~/dev » git clone https://gist.github.com/5315168.git
     Cloning into '5315168'...
    

remote: Counting objects: 6, done.