Skip to content

Instantly share code, notes, and snippets.

View ethan-funny's full-sized avatar
:octocat:
Focusing

Ethan ethan-funny

:octocat:
Focusing
View GitHub Profile
@ethan-funny
ethan-funny / clients.md
Created December 3, 2015 04:52 — forked from defunkt/clients.md
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@ethan-funny
ethan-funny / uninstall_homebrew.sh
Created February 4, 2016 07:47 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@ethan-funny
ethan-funny / rest-server.py
Created June 4, 2016 15:20 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
#/usr/bin/env python
#coding=utf8
import httplib
import md5
import urllib
import random
appid = '20151113000005349'
secretKey = 'osubCEzlGjzvw8qdQc41'
@ethan-funny
ethan-funny / 00-about-search-api-examples.md
Created July 11, 2016 08:10 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@ethan-funny
ethan-funny / flask-rest-server.py
Created August 17, 2016 03:57
flask restful api
# -*- coding: utf-8 -*-
from flask import Flask, jsonify, abort, make_response
from flask import request
app = Flask(__name__)
articles = [
{
'id': 1,
@ethan-funny
ethan-funny / Vagrantfile
Created August 24, 2016 09:24 — forked from jbgo/Vagrantfile
Getting started with ansible on OS X
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.ssh.forward_agent = true
@ethan-funny
ethan-funny / beautiful_idiomatic_python.md
Created October 9, 2016 02:24 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@ethan-funny
ethan-funny / license-badges.md
Created February 14, 2017 02:23 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Want to add a License?

Comment this gist or write me an E-Mail (lukas@himsel.me)

@ethan-funny
ethan-funny / cleaner.py
Created February 20, 2017 07:31 — forked from lawlesst/cleaner.py
cleaning invalid characters from xml
def invalid_xml_remove(c):
#http://stackoverflow.com/questions/1707890/fast-way-to-filter-illegal-xml-unicode-chars-in-python
illegal_unichrs = [ (0x00, 0x08), (0x0B, 0x1F), (0x7F, 0x84), (0x86, 0x9F),
(0xD800, 0xDFFF), (0xFDD0, 0xFDDF), (0xFFFE, 0xFFFF),
(0x1FFFE, 0x1FFFF), (0x2FFFE, 0x2FFFF), (0x3FFFE, 0x3FFFF),
(0x4FFFE, 0x4FFFF), (0x5FFFE, 0x5FFFF), (0x6FFFE, 0x6FFFF),
(0x7FFFE, 0x7FFFF), (0x8FFFE, 0x8FFFF), (0x9FFFE, 0x9FFFF),
(0xAFFFE, 0xAFFFF), (0xBFFFE, 0xBFFFF), (0xCFFFE, 0xCFFFF),
(0xDFFFE, 0xDFFFF), (0xEFFFE, 0xEFFFF), (0xFFFFE, 0xFFFFF),