Skip to content

Instantly share code, notes, and snippets.

View rossdylan's full-sized avatar

Ross Delinger rossdylan

View GitHub Profile
@rossdylan
rossdylan / emoji.swift
Last active January 10, 2021 05:38
wat
func sleep_cry_pumpkin_snake(horse_ghost_cd_camcorder: [[String]]) -> Void {
var whale_cat_mailbox_flag_symbols = [Int](count: horse_ghost_cd_camcorder.count, repeatedValue: 0)
var shooting_star = 0
ambulance_horse(horse_ghost_cd_camcorder, whale_cat_mailbox_flag_symbols)
while true {
if shooting_star >= horse_ghost_cd_camcorder.count {
return
} else if whale_cat_mailbox_flag_symbols[shooting_star] < horse_ghost_cd_camcorder[shooting_star].count - 1 {
ant_pigsnout_penguin_monkey(&whale_cat_mailbox_flag_symbols, shooting_star)
whale_cat_mailbox_flag_symbols[shooting_star] += 1
@rossdylan
rossdylan / scrolling.html
Created October 2, 2013 21:29
scrolling barchart with chart.js
<!doctype html>
<html>
<head>
<script src="Chart.js"></script>
</head>
<body>
<canvas id="canvas" height="450" width="1000"></canvas>
<script>
var data = {
labels: ["","","","","","","","","","","","","","","","","","","",""],
@rossdylan
rossdylan / compose.py
Created August 7, 2012 16:37
Function composition in python
from functools import partial
def _composed(f, g, *args, **kwargs):
return f(g(*args, **kwargs))
def compose(*a):
try:
return partial(_composed, a[0], compose(*a[1:]))
except:
return a[0]
@rossdylan
rossdylan / insanity.py
Created June 25, 2012 17:23
Pure insanity in one line
(lambda args: map(lambda repo: __import__("os").system('git clone {0} {1}/{2}'.format(repo.git_url,args.backupdir,repo.name)),__import__("pygithub3").Github().repos.list(args.username).all()))((lambda : (lambda : [globals().update(argparser=__import__("argparse").ArgumentParser(description="Backup allyour github repos")),map(lambda arg: globals()["argparser"].add_argument(*arg["args"],**arg["kwargs"]),[{"args": ("username",),"kwargs": {"help": "A Github username"}},{"args": ("backupdir",),"kwargs": {"help": "The folder where you want your backups to do"}}]),globals()["argparser"].parse_args()])()[-1])())
@rossdylan
rossdylan / curry.py
Created February 19, 2014 01:13
better implict function currying in python
from functools import partial
from inspect import getargspec
class Curryable(object):
"""
A decorator that implements implicit function currying in python
What this means is if you call a function with only part of its required
parameters, it will return a function that takes the remaining paramters
"""
def __init__(self, numArgs=-1):
@rossdylan
rossdylan / 3sync.go
Created August 27, 2013 02:17
attempting to sync files to s3 using golang and goamz
package main
import (
"crypto/md5"
"flag"
"fmt"
"io"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
"os"
@rossdylan
rossdylan / bogo.template
Last active January 1, 2016 19:29
Check to see if Harlan's fucking bogosort from hell is still running. I probably didn't need to use gorilla/mux but who the hell cares.
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<title>Is Harlan's BogoSort Running?</title>
<style> h1 { font-size: 100px; } </style>
@rossdylan
rossdylan / sslcheck.go
Last active December 27, 2015 15:19
check some servers ssl certs
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"net"
"net/smtp"
@rossdylan
rossdylan / cshsay.go
Created October 29, 2013 20:42
Annoy your friends!
package main
import "github.com/thoj/go-ircevent"
import "os"
import "os/exec"
import "strings"
import "fmt"
func CowSay(msg string) {
new_msg := strings.Replace(msg, "#", "hashtag ", -1)
@rossdylan
rossdylan / scccam.py
Created October 12, 2013 21:32
Pull images from public traffic cameras owned by the city of santa clara.
import requests
import json
import pprint
import xml.etree.ElementTree as ET
import argparse
from fabulous import image
from StringIO import StringIO
def find_intersections(lines):