Skip to content

Instantly share code, notes, and snippets.

View emrox's full-sized avatar
🐱

Stefan Bauckmeier emrox

🐱
View GitHub Profile
@emrox
emrox / pattern.xml
Created January 21, 2012 20:53 — forked from rubiii/pattern.xml
reuse xml schema pattern via nokogiri
<xsd:pattern xmlns:xsd="http://www.w3.org/2001/XMLSchema" value="\d{3}-[A-Z]{2}"/>
@emrox
emrox / META Tag Regex Matching
Created December 20, 2012 17:04
Regular Expression for matching META Tags from a HTML Source
<meta\s*(?:(?:\b(?:\w|-)+\b\s*)=\s*(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*)*\/?>
- empty Meta Tags
- XHTML Styled Meta Tags (<meta />) and normal HTML Meta Tags (<meta>)
- single and double quote marks are supported
- Values can contain escaped quote marks (<meta name="test\"name" />)
@emrox
emrox / gist:4351973
Created December 21, 2012 10:21
A One-Liner for checking Links in a .txt File for their returned Status-Codes (200, 301, 404, ...)
cat linklist.txt | xargs -i~ curl -o /dev/null --silent --write-out '~ %{http_code}\n' \~ > linklist.checked.txt

Keybase proof

I hereby claim:

  • I am emrox on github.
  • I am emrox (https://keybase.io/emrox) on keybase.
  • I have a public key whose fingerprint is EB76 E532 647A 2F64 61D4 0A25 DB7B 9CB7 613A FDEA

To claim this, I am signing this object:

@emrox
emrox / production_log_stats.pl
Created April 14, 2016 09:01
Rails production log partial timing
#!/usr/bin/perl
# use with: cat producion.log | perl production_log_stats.pl
use warnings;
use strict;
use List::Util qw(sum);
my $filestats_ref = ();
@emrox
emrox / overcome gravity - resources.md
Created February 8, 2017 22:07
Overcome Gravity - Resources
@emrox
emrox / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 25, 2017 12:33 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

Git Commit Emojis

  • ⭐️ (feat) for commits related to adding new features.
  • 🛠 (fix) for commits related to fixing broken code.
  • 🍺 (chore) for commits that are just chores.
  • 📝 (doc) for commits related to adding and maintaining documentation.
  • ♻️ (refa) for commits related to refactoring code and making it work better.
  • 🔍 (test) for commits related to writing or fixing tests.
  • 🌈 (style) for commits related to making your code or your app beautiful with style changes.
@emrox
emrox / plink-plonk.js
Created February 24, 2020 16:19 — forked from tomhicks/plink-plonk.js
Listen to your web pages
[
{
"title": "Project Hail Mary",
"author": "Andy Weir",
"genre": "Science Fiction",
"isbn": "9780593135204"
},
{
"title": "The Martian",
"author": "Andy Weir",