Skip to content

Instantly share code, notes, and snippets.

Dylan Roy dylanroy

Block or report user

Report or block dylanroy

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
@dylanroy
dylanroy / histdel.sh
Last active Jun 22, 2016
Example Usage: histdel.sh www.domain.com
View histdel.sh
#!/bin/bash
DATABASE=~/Library/Application\ Support/Google/Chrome/Default/History
URL=""
print_usage()
{
printf "usage: `basename $0` URL\n"
exit 1;
}
@dylanroy
dylanroy / split-file.sh
Last active Jun 17, 2016
Splits up a file into multiple 1gb archives.
View split-file.sh
# Make sure you zip up the file first
echo "Splitting up archive $1"
tar -cvzf $1.tar.gz $1
split -b 1024mb $1.tar.gz $1.tar.gz.
View run-local.sh
docker-machine create -d virtualbox dev
eval $(docker-machine env dev)
docker-machine ls
docker-compose build
docker-compose up -d
echo `docker-machine ip dev`
@dylanroy
dylanroy / mandelbrot.sql
Last active Aug 29, 2015 — forked from rupey/mandelbrot.sql
Mandelbrot plot in postgres
View mandelbrot.sql
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
View tweet_dumper.py
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
View draw_straws.py
import random
NUMBER_OF_PLAYERS = 5
NUMBER_OF_ITERATIONS = 1000000
def main():
if NUMBER_OF_PLAYERS < 2:
raise ValueError("Must have at least 2 people.")
if NUMBER_OF_ITERATIONS < 1:
View RedisPythonPubSub1.py
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@dylanroy
dylanroy / minimum.html
Created Feb 5, 2014
Base Html Templates
View minimum.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="" rel="stylesheet" />
<style></style>
</head>
<body>
View request_time.py
#!/usr/bin/env python2.7
import time
_URL = 'http://localhost/tmp/derp.html'
_NUMBER = 1000
def test_urllib2():
import urllib2
View README.md

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

You can’t perform that action at this time.