Skip to content

Instantly share code, notes, and snippets.

View insanity54's full-sized avatar

Chris Grimmett insanity54

View GitHub Profile
@uberscientist
uberscientist / gist:8a89ff8b7810275f322f
Created July 3, 2015 19:56
quick gist of dreaming video
# could be a lot more readable if I just broke the deepdream out into a module...
import os
#Copied from deepdream iPython notebook
# imports and basic notebook setup
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from google.protobuf import text_format
@insanity54
insanity54 / bash dirname path
Last active October 22, 2015 23:41
Get the absolute path of the directory of the bash script
#!/bin/bash
# Gets the absolute path of the directory of this bash script. works in Linux & OSX
# greets to https://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script
# greets to https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx
function detectplatform {
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@alisterscott
alisterscott / watir-webdriver-downloads.rb
Created June 15, 2012 11:46
How to check for downloads to complete and get the file name
require 'watir-webdriver'
file_name = nil
download_directory = "#{Dir.pwd}/downloads"
download_directory.gsub!("/", "\\") if Selenium::WebDriver::Platform.windows?
downloads_before = Dir.entries download_directory
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.folderList'] = 2 # custom location
profile['browser.download.dir'] = download_directory
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//