Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben McGinnes Hasimir

View GitHub Profile
@Hasimir
Hasimir / uk-intersex-rights-petition.py
Created Oct 9, 2019
Script to check signatures on UK Intersex equal rights petition
View uk-intersex-rights-petition.py
#!/usr/bin/env python3
import requests
url = "https://petition.parliament.uk/petitions/276273.json"
sigs = []
r = requests.get(url)
data = r.json()['data']['attributes']['signatures_by_constituency']
@Hasimir
Hasimir / jsondentation.py
Last active Apr 22, 2018
Quick and dirty method of making walls of text JSON files indented properly (note, not standards and tab width compliant, just easier to read).
View jsondentation.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
@Hasimir
Hasimir / post.el.diff
Created Mar 11, 2018
Diff of fixes needed to prevent post.el triggering old style backquotes error
View post.el.diff
The post-mode for Mutt/Neomutt and Emacs is old and mostly reliable, still available here:
https://sourceforge.net/projects/post-mode/
In January, 2018 a change was made to the master branch of GNU Emacs which detects old style elisp as incorrect and breaks initialisation which contains it. Since post-mode hasn't been modified in nearly a decade, there are some lines using this older style.
The following is the diff necessary to fix the version of post-mode from 24/2/2008 (ver. 1.9 or 1.10):
305c305
< (defmacro string-read (prompt) (` (read-string (, prompt))))
@Hasimir
Hasimir / app.py
Created May 22, 2016 — forked from maccman/app.py
Stripe Flask Example
View app.py
import os
from flask import Flask, render_template, request
import stripe
stripe_keys = {
'secret_key': os.environ['SECRET_KEY'],
'publishable_key': os.environ['PUBLISHABLE_KEY']
}
stripe.api_key = stripe_keys['secret_key']
@Hasimir
Hasimir / keybase.md
Last active Dec 5, 2017
keybase.io proof
View keybase.md

Keybase proof

I hereby claim:

  • I am Hasimir on github.
  • I am adversary (https://keybase.io/adversary) on keybase.
  • I have a public key whose fingerprint is DB47 24E6 FA42 86C9 2B4E 55C4 321E 4E23 7359 0E5D

To claim this, I am signing this object:

@Hasimir
Hasimir / dot-emacs-utf8
Created Jan 8, 2015
My UTF-8 settings in .emacs
View dot-emacs-utf8
;; UTF-8 settings
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; This was added by Custom at some point too:
'(current-language-environment "UTF-8")
;; Plus I have F7 bound to insert-char to enter the hex for a glyph:
(global-set-key [f7] 'insert-char)
View web-of-trust.md

A pseudonymous trust system for a decentralized anonymous marketplace

Dionysis Zindros, National Technical University of Athens dionyziz@gmail.com

Keywords

pseudonymous anonymous web-of-trust identity trust bitcoin namecoin proof-of-burn timelock decentralized anonymous marketplace openbazaar

Abstract

View ello.md

Ello API

This is a basic exploration of the Ello API. Completely unofficial, your mileage my vary, don't smash their servers as they are likely very busy.

Methods return HTML for their representation where appropriate which is a nice little pattern. Everything returns application/json.

Like this:

{
   "id": <new post ID>,
View inspector-only-black-text.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.ruleview {
color: black;
}