Skip to content

Instantly share code, notes, and snippets.

Kyle Fuller kylef

Block or report user

Report or block kylef

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kylef
kylef / Mocta.md
Last active Aug 29, 2015 — forked from orta/Mocta.md
View Mocta.md

Getting a Mocta object

NSUserDefaults<Mocta> *defaults = [Mocta objectWithClass:[NSUserDefaults class]];
id< UITableViewDelegate , MoctaStub> delegate = [Mocta objectWithProtocol:@protocol(UITableViewDelegate)];

Expectations

Expectations are ran on dealloc, so I don't have to do it manually.

View keybase.md

Keybase proof

I hereby claim:

  • I am kylef on github.
  • I am kylef (https://keybase.io/kylef) on keybase.
  • I have a public key whose fingerprint is 4130 FDF9 EB2D 440D CD17 8114 C73A 0893 E165 0558

To claim this, I am signing this object:

View cloudflare_delete.py
import requests
"""
Simple script to delete every dns entry for a cloudflare domain.
Depends on requests (pip install requests). Then fill in the
following three variables:
"""
token = 'INSERT API TOKEN'
@kylef
kylef / dispatch.fcgi
Created May 21, 2009
Django fastCGI dispatcher
View dispatch.fcgi
#!/usr/bin/env python2.4
import sys, os
from fcgi import WSGIServer
if __name__ == '__main__':
sys.path += ['/home/kylef/python']
os.environ['DJANGO_SETTINGS_MODULE'] = 'kylef.settings'
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()
@kylef
kylef / iphone-update-checker.py
Created Jun 17, 2009
This python script queries iTunes update url to see if iPhone OS 3.0 has been released for the iPhone 3G
View iphone-update-checker.py
import urllib2
import re
from time import sleep
class PageScraper(object):
"""
This class scrapes a url for a string, can be used with a loop.
"""
def __init__(self, url, string=''):
@kylef
kylef / html.py
Created Jul 8, 2009
This middleware strips unnessicery characters from a HTML document in order to save bytes. It will removes things like CR, LR, TAB's and multiples spaces.
View html.py
"""
The idea of this was to strip responses of any unnecessary
characters to save bandwidth, after some testing the savings
were only up-to 8% on rare occasion.
"""
import re
re_is_html = re.compile(r'(*)</html>(*)')
@kylef
kylef / russian_roulette.cpp
Created Jan 10, 2010
This is a russian routlette module which may kick a user when he says !roulette
View russian_roulette.cpp
#include <main.h>
#include <Modules.h>
#include <Chan.h>
class CRussianRoulette_Mod : public CModule {
public:
MODCONSTRUCTOR(CRussianRoulette_Mod) {}
virtual ~CRussianRoulette_Mod() {}
EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) {
@kylef
kylef / irc-znc.xml
Created Jan 10, 2010
This is a SMF script for OpenSolaris for ZNC
View irc-znc.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='znc'>
<service
name='network/irc'
type='service'
version='1' >
<instance name='znc' enabled='false'>
@kylef
kylef / irc-unreal.xml
Created Jan 11, 2010
This is a SMF script for OpenSolaris for UnrealIRCd
View irc-unreal.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='unrealircd'>
<service
name='network/irc'
type='service'
version='1' >
<instance name='unreal' enabled='false'>
<dependency name='network'
@kylef
kylef / getdelim.c
Created Jan 15, 2010
Mac OS X port of getdelim by Simon Josefsson
View getdelim.c
/* getdelim.c --- Implementation of replacement getdelim function.
Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005 Free
Software Foundation, Inc.
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, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
You can’t perform that action at this time.