Skip to content

Instantly share code, notes, and snippets.

View sixtyfive's full-sized avatar
🐯
Rawrrr.

J. R. Schmid sixtyfive

🐯
Rawrrr.
View GitHub Profile
21:36:01.321 PATCH https://cloud.weitnahbei.de/index.php/apps/contacts/addressbook/local/6/contact/91 [HTTP/1.0 501 Not Implemented 123ms]
21:36:01.389 SyntaxError: JSON.parse: unexpected character core.js:5
@sixtyfive
sixtyfive / _form.html.haml
Last active August 29, 2015 14:03
Stables and horses and stuff. Nothing to see here, move along.
= simple_form_for(@stable) do |f|
.form-inputs
# Stable has_one Owner.
%fieldset{:name => "owner"}
= f.simple_fields_for :owner do |o|
# Straightforward here...
- if @stable.owner.picture.exists?
= o.input :delete_picture, :as => :boolean, :class => 'delete_picture'
@sixtyfive
sixtyfive / pdf2png2pdf.sh
Last active August 29, 2015 14:03
Convert 2 PDFs into PNGs while keeping the pages in order, half them down the middle and then regroup them into one PDF
#!/bin/bash
NAME_PDF1="1.pdf"
NUMPAGES_PDF1="100"
NAME_PDF2="2.pdf"
NUMPAGES_PDF2="100"
NAME_OUTPUT="out.pdf"
mkdir tmp{1,2}
@sixtyfive
sixtyfive / geoiplookup.rb
Created July 23, 2014 15:01
Look up the location for a given IP using MaxMind's GeoIPLite2 database
#!/usr/bin/env ruby
require 'maxminddb'
db = MaxMindDB.new('/usr/share/GeoIP/GeoLite2-City.mmdb')
ret = db.lookup(ARGV[0])
if ret.found?
if ret.city.name
puts "#{ret.city.name}, #{ret.country.name}"
# Wordpress configuration
"^/(.*/)?files/$" => "/index.php",
"^/(.*/)?files/(.*)" => "/wp-includes/ms-files.php?file=$2",
"^(/wp-admin/.*)" => "$1",
"^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
"^/([_0-9a-zA-Z-]+/)?(.*\.php)" => "/$2",
"^/(.*)/?$" => "/index.php"
@sixtyfive
sixtyfive / index.html
Created October 1, 2014 18:53
Simple placeholder page in HTML5 and with pretty webfont
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TITLE</title>
<script src="http://use.edgefonts.net/lobster-two.js"></script>
<style type="text/css">
header {
margin: auto;
position: absolute;
Work Safety Rules
Think before you act
Wear security shoes
Wear face mask
Use eye and hearing protection
Use hardhat
Access only
Wear safety belts
Climbing forbidden
Authorized personnel only
@sixtyfive
sixtyfive / Compiler command
Created January 6, 2015 19:03
Looking at ASM output for a simple C program
gcc -c -g -Wa,-a,-ad test.c > foo.lsk
@sixtyfive
sixtyfive / Compiler command
Created January 6, 2015 19:28
Looking at ASM output for a simple C program
gcc -c -g -Wa,-a,-ad test.c > test.lsk
@sixtyfive
sixtyfive / sailofyourtwoeyes.tex
Last active August 29, 2015 14:13
Arabic poem typeset for playing around with ConTeXt font handling
%---------------------------------------------------------------------------
% Lovely without vowelisation: diwanibent (decorated), diwaniletter (fancy),
% scheherazade (conservative), oldanticdecorative, irannastaliq, bfantezy,
% bdavat, barabicstyle (like omani handwriting), arial (plain; readable),
% andalus (kufi script), amiri (conservative; nice ligatures), tholoth
%
% Working well with vowelisation: rabat, arabictypesetting
%
% Not displaying correctly (i.e. broken): traditionalarabic
%