Skip to content

Instantly share code, notes, and snippets.

View jerluc's full-sized avatar
😵‍💫

Jeremy Lucas jerluc

😵‍💫
View GitHub Profile
@miketoth
miketoth / turn-down.sh
Last active June 30, 2018 16:19
TURN DOWN FOR WHAT MAC ONLY SORRY
#!/bin/bash
VOL=$(osascript -e "output volume of (get volume settings)")
NEWVOL=0
while true
do
if (($VOL == $NEWVOL)); then
$(osascript -e "set volume output volume 100")
echo $(osascript -e "output volume of (get volume settings)")
$ curl -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3" http://urx.io/107.170.233.189
<!doctype html>
<html>
<head>
<title>Redirecting...</title>
<style type="text/css">
body {
background-color: #FFFFFF;
}
</style>
@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

@hvoecking
hvoecking / translate.go
Last active March 28, 2024 13:52
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@kotnik
kotnik / small-dns-server.py
Created June 6, 2013 14:51
Example of how to create a DNS server in Python, based on Twisted libraries.
from collections import Mapping
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
class MapResolver(client.Resolver):
def __init__(self, mapping, servers):
client.Resolver.__init__(self, servers=servers)
@dustin
dustin / tcpproxy.go
Last active December 16, 2015 18:39
hex dumping tcp proxy
package main
import (
"encoding/hex"
"flag"
"io"
"io/ioutil"
"log"
"net"
"os"
@shanselman
shanselman / gist:5422230
Last active March 28, 2024 10:33
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@jerluc
jerluc / hello.rift
Last active December 16, 2015 05:08
Rift Source + PEG-generated AST XML
hello {
// Create our simple function
sum(a, b) => a + b
// Create a function to defer the computation
deferredSum(a, b) => => sum(a, b)
// Bind the evaluation of the computation in "myThread" to variable "a"
a := deferredSum(10, 20) @ myThread
// Print out the value once it's available
print(a)
}
@viktorklang
viktorklang / minscalaactors.scala
Last active March 25, 2024 19:01
Minimalist Scala Actors
/*
Copyright 2012-2021 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@johnboxall
johnboxall / dns.py
Created August 15, 2011 21:57
Twisted DNS server!
# http://notmysock.org/blog/hacks/a-twisted-dns-story.html
# http://blog.inneoin.org/2009/11/i-used-twisted-to-create-dns-server.html
# twistd -y dns.py
import socket
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor
from twisted.names import dns
from twisted.names import client, server