Skip to content

Instantly share code, notes, and snippets.

View codingisacopingstrategy's full-sized avatar

Eric Schrijver codingisacopingstrategy

View GitHub Profile
#!/usr/bin/env python
import fontforge
from glob import glob
# http://stackoverflow.com/questions/2828953/silence-the-stdout-of-a-function-in-python-without-trashing-sys-stdout-and-resto
import contextlib
import sys
import csv
import os
import re
@codingisacopingstrategy
codingisacopingstrategy / excerpt.html
Last active December 24, 2015 04:38
Trying to load, https://github.com/alohaeditor/Aloha-Editor/blob/dev/src/plugins/common/link/extra/linklist.js but doesn’t seem to work. Aloha.settings.repositories doesn’t exist.
<script>
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
plugins: {
format: {
// configure buttons available in the toolbar
// this example enables all buttons available
config : [ 'strong', 'em', 'b', 'i', 'del', 'sub', 'sup', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'code', 'pre', 'removeFormat'],
// specific configuration for each editable identified by css selectors
editables : {
Facebook Blocks Log-ins from Tor Browser Putting Thousands of Political Activists at Risk
Facebook has blocked log-ins via the encrypted and anonymous browser TOR. This will lead thousands of political activists to login via their own IP address, unlike when they log-in via TOR at a different IP. This means that their identities might be revealed to tyrant regimes in countries such as Syria, Jordan, Iraq Saudi Arabia and elsewhere, since Facebook’s SSL connection can be broken easily by technology obtained by these regimes from American and British companies. This means facebook is now risking the lives and freedom of thousands of people by this stupid move.
This is also a sad day for privacy advocates.
Wael Ghonima, who is the former Google MENA marketing director, used TOR when logging in to his “We are all Khaled Saed page” which called for the Egyptian revolution. Secret police of Husni Moubrak where on a hunt to know the person behind Khaled Saed. Had Wael his identity been revealed before the revolut
@codingisacopingstrategy
codingisacopingstrategy / gist:5118109
Created March 8, 2013 17:17
I store my python environments in a folder called venv. I got tired of typing source ~/venvs/name-of-environment/bin/activate
#!/bin/bash
source "/home/$(whoami)/venvs/$1/bin/activate"
# usage:
# ve name-of-venv
@codingisacopingstrategy
codingisacopingstrategy / gist:5117953
Last active September 12, 2016 07:00
my i3 ~/.i3/config ( i3 is a window manager http://i3wm.org/ )
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
var isExternal = function(href) {
/*
* isExternal("http://i.liketightpants.net/")
* true
* isExternal("/publications/")
* false
* isExternal("http://spion.me/publications/")
* false
* isExternal("http://localhost:8000/publications/")
* false
// Teken een pijl met een vertex (p30) en stop hem in een functie (hoofdstuk 8)
// Roep de functie één keer aan in de draw-code
// Resultaat: hetzelfde als gewoon direct de vertex tekenen
void setup() {
size(480, 120);
}
void tekenPijl() {
beginShape();
@codingisacopingstrategy
codingisacopingstrategy / test1.py
Created October 28, 2011 16:36 — forked from tian2992/test1.py
Drawing With Shoebot as a Module
import shoebot
from shoebot.core import CairoCanvas, CairoImageSink, NodeBot
outputfile = 'output.svg'
sink = CairoImageSink(outputfile, "svg", multifile = False)
canvas = CairoCanvas(sink, enable_cairo_queue=True)
bot = shoebot.core.NodeBot(canvas)
bot.size(150,150)
bot.fill(1,0,0)
bot.rect(10,10,100,100)
bot._canvas.flush(frame=0)
@codingisacopingstrategy
codingisacopingstrategy / customfeed.py
Created August 18, 2011 20:02
Gets all OSP git commits
#!/usr/bin/env python
"""
This script downloads, sorts, and merges
entries from different RSS feeds
and writes the output to a local file.
The result is a custom feed containing
all the specified ones.
"""
__version__="0.1"
@codingisacopingstrategy
codingisacopingstrategy / get_commons.py
Created June 4, 2011 11:51
Print urls of all images in a category of Wikimedia Commons
#!/usr/bin/env python
# print the urls of all the images in a category of Wikimedia Commons
# example:
# $ python get_commons.py "Category:ScottForesman-raw"
# pipe to wget for download:
# $ python get_commons.py [category] | wget -i - --wait 1
import sys
import json