Skip to content

Instantly share code, notes, and snippets.

View paulmwatson's full-sized avatar

Paul M. Watson paulmwatson

View GitHub Profile
@bzamecnik
bzamecnik / installing_cuda_on_azure_nc_tesla_k80_ubuntu.md
Last active January 18, 2022 21:13
Installing NVIDIA CUDA on Azure NC with Tesla K80 and Ubuntu 16.04
@ftiasch
ftiasch / server.py
Created August 13, 2015 09:52
python SimpleHTTPServer with custom MIME types
import SimpleHTTPServer
import SocketServer
PORT = 8000
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
Handler.extensions_map['.shtml'] = 'text/html'
@Smerity
Smerity / fetch_page.py
Created August 7, 2015 21:30
An example of fetching a page from Common Crawl using the Common Crawl Index
import gzip
import json
import requests
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
# Let's fetch the Common Crawl FAQ using the CC index
resp = requests.get('http://index.commoncrawl.org/CC-MAIN-2015-27-index?url=http%3A%2F%2Fcommoncrawl.org%2Ffaqs%2F&output=json')
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@JamieMason
JamieMason / unfollow.js.md
Last active May 16, 2024 03:26
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
var neverGonna = ["give you up", "let you down", "run around and desert you", "make you cry", "say goodbye", "tell a lie and hurt you"];
for (var i=0; i<neverGonna.length; i++){
console.log("Never gonna " + neverGonna[i]);
}
@denmarkin
denmarkin / resque.rake
Created September 20, 2011 11:02
My rake task for clearing Resque queues and stats
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
@blackwatertepes
blackwatertepes / pow
Created April 28, 2011 22:35
Shell script for creating/destroying/opening .pow symlinks
#!/bin/bash
# Scripts for creating/deleting/viewing pow symlinks
# Created by Tyler J. (first ever bash!!!)
a=`pwd`
b=`basename -a $a`
create()
{
# Create a pow symlink