Skip to content

Instantly share code, notes, and snippets.

@robwiss
robwiss / numpy gol engine
Created October 1, 2013 16:33
version of Nippashish's numpy gol engine that implements last_step
import numpy as np
from scipy import signal
import itertools
class Grid(object):
def __init__(self, rows, cols):
self._grid = np.zeros((rows, cols), dtype=np.float)
self._neighbourhood = np.array([
[ 1, 1, 1 ],
[ 1, 0, 1 ],
@robwiss
robwiss / BunkerAdvantage.ipynb
Created October 8, 2013 20:50
Analysis of the advantage given by bunkers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robwiss
robwiss / boost1.55.0.diff
Last active August 29, 2015 14:07
boost-gcc 1.55.0 patch
Index: Makefile
===================================================================
--- Makefile (revision 24202)
+++ Makefile (working copy)
@@ -1,8 +1,7 @@
# $Id$
NAME = boost
-VERSION = 1.49.0
-CATEGORIES = lib
@robwiss
robwiss / gist:06ef1cc830f43a91a57b
Created May 23, 2015 00:15
code that will create race condition involving turtle mock::sequence
#define BOOST_TEST_DYN_LINK 1
#define BOOST_TEST_MODULE test_sequence
#define MOCK_THREAD_SAFE
#include <boost/test/unit_test.hpp>
#include <turtle/mock.hpp>
#include <thread>
#include <mutex>
# Copyright 2017 Robert Wissmann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR T
--- /root/src/gitlist/themes/default/js/showdown.js 2014-09-02 17:06:41.000000000 -0400
+++ showdown.js 2016-12-06 13:35:16.933049198 -0500
@@ -746,6 +746,15 @@
}
}
+ var isAbs = new RegExp('^(?:[a-z]+:)?//', 'i');
+ if (! isAbs.test(url))
+ {
+ var currentlocation = window.location['href'];
diff --git a/src/Controller/TreeController.php b/src/Controller/TreeController.php
index d3d9fe6..3686de4 100644
--- a/src/Controller/TreeController.php
+++ b/src/Controller/TreeController.php
@@ -34,6 +34,7 @@ class TreeController implements ControllerProviderInterface
return $app['twig']->render('tree.twig', array(
'files' => $files->output(),
+ 'repo_path' => $repository->getPath(),
'repo' => $repo,
@robwiss
robwiss / output.log
Created June 30, 2017 21:42
WSL SSH key error when not in user directory
INFO global: Vagrant version: 1.9.6
INFO global: Ruby version: 2.3.4
INFO global: RubyGems version: 2.5.2
INFO global: VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
INFO global: VAGRANT_OLD_ENV_LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35
@robwiss
robwiss / tmdb_poster_get.py
Created December 3, 2017 16:39
get movie posters from themoviedb.com for mp4 files in a directory
# gets movie posters from themoviedb.com for mp4 files in a directory
# MIT License
import os
import requests
import time
import tmdbsimple as tmdb
tmdb.API_KEY = 'YOUR_API_KEY_HERE'
directory = '/movies' # expects to have movies named with format '<Name> (<Year>).mp4'