Skip to content

Instantly share code, notes, and snippets.


Josh Mills trueheart78

View GitHub Profile
View apache-access-log-parser.rb
#!/usr/bin/env ruby
# Helpful link:
require 'date'
line_count = 0[0]).readlines.each do |line|
line_count += 1
result = /^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}).*\[(.*)\].*(GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT)\s(.*)\"\s(\d+)\s(\d+)(.*)$/.match(line)
View sludgehammer.user.js
// ==UserScript==
// @name SludgeHammer
// @namespace gamerswithjobs
// @description Replaces marketing speak with English
// @exclude /github/
// @author Chris Doggett
// ==/UserScript==
// Special thanks to Jeremy Banks at
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})};
trueheart78 /
Created May 28, 2021 — forked from willurd/
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