Skip to content

Instantly share code, notes, and snippets.

View jerluc's full-sized avatar
😵‍💫

Jeremy Lucas jerluc

😵‍💫
View GitHub Profile
@jerluc
jerluc / test_exception.py
Created June 14, 2019 00:32
Testing aiohttp web exceptions
from aiohttp import web
def test_exception(request):
text_or_reason = request.query["type"]
raise web.HTTPBadRequest(**{text_or_reason: "The request was bad!"})
if __name__ == "__main__":
app = web.Application()

Keybase proof

I hereby claim:

  • I am jerluc on github.
  • I am jerluc (https://keybase.io/jerluc) on keybase.
  • I have a public key ASCU1QCdS89cSPV4uhZl0moOuRzXt8P-WKjnjt7GnyN7Pgo

To claim this, I am signing this object:

while True:
stuff = raw_input("Write some stuff with more than 4 characters!")
if len(stuff) < 4:
print "Boo. That was too short. Try again."
pass
else:
print stuff[3:len(stuff) +1]
break
@jerluc
jerluc / linkedlist.c
Created March 2, 2016 19:23
A simple linked list implementation
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define LL_OK 0
#define LL_NOTOK 1
typedef struct ll_node {
void* value;
struct ll_node* next;
first_name = 'Elliott'
last_name = 'Lucas'
# What does this output?
print(first_name + last_name)
@jerluc
jerluc / lacey.py
Created August 31, 2015 06:30
Lacey's first program
def turtle(name, num):
for n in range(num):
if n < num-1:
print(name + ",")
else:
print(name)
turtle("Lacey Leeder", 10)
@jerluc
jerluc / Resolve.java
Last active August 29, 2015 14:11
Resolving a deeplink on Android using a plain URI and the URX SDK
package my.cool.app;
import android.content.Context;
import com.urx.android.AndroidClient;
import com.urx.android.resolve.AndroidResolver;
import com.urx.core.ClientConfig;
import com.urx.core.resolution.UriResolve;
public class Resolve {
@jerluc
jerluc / worldcup.csv
Created July 7, 2014 07:18
2014 World cup scores
date team_1 team_1_score team_2 team_2_score
2014-06-12 Brazil 3 Croatia 1
2014-06-13 Mexico 1 Cameroon 0
2014-06-17 Brazil 0 Mexico 0
2014-06-18 Cameroon 0 Croatia 4
2014-06-23 Cameroon 1 Brazil 4
2014-06-23 Croatia 1 Mexico 3
2014-06-13 Spain 1 Netherlands 5
2014-06-13 Chile 3 Australia 1
2014-06-18 Spain 0 Chile 2
@jerluc
jerluc / contents.markdown
Last active March 9, 2016 20:57
Open content linking proposal

On linking content across varying media

A brief history of hypertext documents

Many of the technologies being built today are based on the ideas initially conceived by post-World War II scientists. In fact, it was in July of 1945, when Dr. Vannevar Bush described the ["memex" device][2], a device with an uncanny resemblance to the Internet:

A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility.

Only twenty years later in 1965, Ted Nelson, inspired by the same Dr. Bush, would conceive of the idea that content and documents should be ["hyperlinked"][3]. And finally in 1990, [Tim Berners-Lee along with some of his colleagues][4], would tie the concept of the hyperlink together with the idea of an inter-connected world to develop what we know now today as the Internet, allowing humankind to access and link information across vast distances almost instantly.

The disconnec

@jerluc
jerluc / osd-remove.sh
Created February 16, 2014 01:12
Ceph OSD removal
# As sudo
ceph osd crush remove osd.{osd-num}
ceph auth del osd.{osd-num}
ceph osd rm {osd-num}
ceph osd crush remove {host}