Skip to content

Instantly share code, notes, and snippets.

View Boldewyn's full-sized avatar

Manuel Strehl Boldewyn

View GitHub Profile
@Boldewyn
Boldewyn / mk
Last active December 17, 2015 07:48
Search Makefiles recursively and run make(1) there, if one is found
#!/bin/bash
#
# Search Makefiles recursively and run make(1) there, if one is found
#
DEPTH=$(pwd | tr -c -d / | wc -c)
MOD=.
while [[ $DEPTH > 0 ]]
do
@don1138
don1138 / font-stacks.css
Last active May 14, 2024 13:16
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
@coffeemug
coffeemug / gist:6168031
Last active February 3, 2022 23:16
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.
@Boldewyn
Boldewyn / evaluate_404s
Created August 28, 2013 09:27
Use bash-foo to print all Apache log 404s in the order how often they appeared
#!/bin/bash
LOGFOLDER=/var/log/apache2
FIELD=7
HTTP_CODE=404
LOG_BASENAME=access.log
cd "$LOGFOLDER"
# print all zipped logfiles (suppressing errors)
@Ed-von-Schleck
Ed-von-Schleck / gist:6391140
Last active December 22, 2015 00:39
Argumentor - generator a command line interface
import sys
if sys.version_info.major != 3 or sys.version_info.minor < 3:
print("This module requires Python version 3.3 or later")
sys.exit(1)
import argparse
import inspect
class Argumentor:
@TheMcMurder
TheMcMurder / index.html
Last active March 14, 2023 17:51
Convert SVG file from absolute to relative
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</head>
<div class="page-header">
<center>
@cowboy
cowboy / get-script.js
Last active December 23, 2015 23:59
javascript: get last script by src filename
// For Remy
function getLastScriptBySrc(filename) {
var scripts = document.scripts;
var i = scripts.length - 1;
while (i--) {
if (scripts[i].src.slice(-filename.length) === filename) {
return scripts[i];
}
}
@mathiasbynens
mathiasbynens / README.md
Last active June 3, 2023 08:09
Quick and dirty user script that displays a Markdown-formatted link to the current code point detail page after double-clicking the title

Try it on the detail page for U+1F4A9 PILE OF POO, for example.

Screenshot after double-clicking the <h1>:

@kanmeiban
kanmeiban / Why Recruiters Are Universally Hated
Created November 22, 2013 20:22
Dealing with recruiters is as nice as dealing with faecal matter. You'd better flush as soon as possible.
Why Recruiters Are Universally Hated
On 14. January 2013 I was invited for a job interview in London by Mr Ethan James of recruiting company
TestDriven IT Group on behalf of his client, a start-up looking for Ruby on Rails developer. Mr Ethan
James proposed I should fly with a low cost jet to get full reimbursement on my tickets. Hower I prefer
rail and sea transport to air travel beacause of their smaller environmental footprint so we agreed that
TestDriven IT Group will cover only half of my travel costs. The interview went well, I wasn’t hired so
I traveled back to my home country through the snow covered Europe, sent a scan of the tickets to the
recruiters upon my arrival and waited for the reimbursement to come.
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"