Skip to content

Instantly share code, notes, and snippets.

View swizzlevixen's full-sized avatar
💁‍♂️
🦋

Mark Boszko swizzlevixen

💁‍♂️
🦋
View GitHub Profile
@swizzlevixen
swizzlevixen / gist:936065
Created April 22, 2011 05:07
SSCrypto not returning Base64 decode
/*
I'm using the SSCrypto framework, but I'm just using it copied into my project source
as a class.
http://septicus.com/products/opensource/
Elsewhere in the SSCrypto class, I call this with an NSString:
*/
/**
@swizzlevixen
swizzlevixen / mnb_dayo_dfp.txt
Created November 6, 2011 04:05
My Day-O Date Format Pattern String
E yyyy.MM.dd_HH:mm z
@swizzlevixen
swizzlevixen / gist:1889278
Created February 23, 2012 02:21
Call Objective-C methods from UIWebView, with optional argument
//
// by Mark Boszko
//
// Expanded from code by DAMIEN LE BERRIGAUD
// http://meliondesign.blogspot.com/2010/02/mapping-uiwebview-links-to.html
//
//
// Sample code to return a method call,
// with or without argument, from UIWebView
// links with format:
@swizzlevixen
swizzlevixen / gist:03c45bd9d23a162114ff
Created June 1, 2014 04:24
De-pack string representation of page ranges into an int list, sort, and re-pack
def depack(value):
"""
:type value: str
"""
print "depack"
page_list = []
for part in value.split(','):
if '-' in part:
a, b = part.split('-')
@swizzlevixen
swizzlevixen / MultiRangeField.py
Created June 1, 2014 17:24
Django MultiRangeField and MultiRangeFormField
__author__ = 'Mark Boszko'
import re
from operator import itemgetter
from itertools import groupby
from django.core.exceptions import ValidationError
from django.db import models
from django.forms import CharField
@swizzlevixen
swizzlevixen / internal_links_filter.py
Created November 9, 2014 00:41
Django Internal Links for TextFields
@swizzlevixen
swizzlevixen / virtualenv-py3-django.markdown
Last active August 29, 2015 14:24
Making a virtual environment with Python 3.4 and Django on Mac OS X

Tested on OS X 10.10.4 Yosemite, 2015-07-06

Install Python 3.4 from downloadable installer from https://www.python.org/downloads/

mkvirtualenv --python=/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 envname

(To re-start the virtualenv, workon envname)

Install basics:

@swizzlevixen
swizzlevixen / ticket-scanner.py
Created August 10, 2015 00:21
Python OpenCV program to extract ticket stub images from photographs, via automatic perspective correction for quadrilateral objects.
#!/usr/local/bin/python
# coding: utf-8
import cv2
import sys
import numpy
from matplotlib import pyplot as plt
from scipy.spatial import distance
"""
@swizzlevixen
swizzlevixen / osx-server-well-known.markdown
Last active December 6, 2015 18:04
Trying to resolve a conflict with OS X Server and a web directory named "/.well-known" so I can authorize a letsencrypt.org certificate.

I'm trying to figure out if OS X Server has, for some reason, reserved the directory name /.well-known, and if so, how to work around it, so that I can authenticate my server for requesting an SSL certificate with letsencrypt.org.

During the letsencrypt authentication process, I must put a challenge response on my server, at the URL path:

http://example.com/.well-known/acme-challenge/<challenge key>

However, while dot-hidden paths like /.the-directory are served just fine, I seem to have narrowed down

Keybase proof

I hereby claim:

  • I am bobtiki on github.
  • I am bobtiki (https://keybase.io/bobtiki) on keybase.
  • I have a public key ASD3KW7dTV1Jw6fDQ59yTRz94mK4i1cYB6YczHb7IW2g6go

To claim this, I am signing this object: