Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name ipol-cart
// @namespace http://tampermonkey.net/
// @version 0.1
// @description add a cart to store IPOL images
// @author kidanger
// @match https://ipolcore.ipol.im/demo/clientApp/demo.html*
// @grant none
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
@uduse
uduse / show_array.py
Last active November 27, 2017 15:06 — forked from zori/showarray.py
Minimal code for rendering a numpy array as an image in a Jupyter notebook in memory. Forked and updated for Python 3.
import PIL.Image
from io import BytesIO
import IPython.display
import numpy as np
def show_array(a, fmt='png'):
f = BytesIO()
PIL.Image.fromarray(np.uint8(a)).save(f, fmt)
IPython.display.display(IPython.display.Image(data=f.getvalue()))
@0xjac
0xjac / private_fork.md
Last active May 27, 2024 20:28
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@kylemcdonald
kylemcdonald / showarray.py
Created January 3, 2016 08:56
Minimal code for rendering a numpy array as an image in a Jupyter notebook in memory. Borrowed from the Deep Dream notebook.
import PIL.Image
from cStringIO import StringIO
import IPython.display
import numpy as np
def showarray(a, fmt='png'):
a = np.uint8(a)
f = StringIO()
PIL.Image.fromarray(a).save(f, fmt)
IPython.display.display(IPython.display.Image(data=f.getvalue()))
@karpathy
karpathy / min-char-rnn.py
Last active May 29, 2024 10:18
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@ashelly
ashelly / mediator.c
Created May 28, 2013 20:36
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t