Skip to content

Instantly share code, notes, and snippets.

bishboria /
Last active Jul 2, 2021
Springer made a bunch of books available for free, these were the direct links
""" Poisson-loss Factorization Machines with Numba
Follows the vanilla FM model from:
Steffen Rendle (2012): Factorization Machines with libFM.
In: ACM Trans. Intell. Syst. Technol., 3(3), May.
See also:

Automating reading list management

What I'm using:

zotero Zotero: In browser integration mean that its a single click to save citation information (and a full-text PDF if available)

...but I'm using trello Trello to stay on top of tasks, and my "to-read" list needs to have a presence in my "to-do" list, as Trello gives a better single view of my work than zotero.

What I'd like:

Cards for new "to-read" articles in Trello, automatically - without cut + paste.

karpathy /
Last active Jul 22, 2021
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)
jbwhit /
Last active Aug 18, 2020
Saves Jupyter Notebooks as .py and .html files automatically. Add to the file of your associated profile.
import os
from subprocess import check_call
def post_save(model, os_path, contents_manager):
"""post-save hook for converting notebooks to .py and .html files."""
if model['type'] != 'notebook':
return # only do this for notebooks
d, fname = os.path.split(os_path)
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)
paulochf /
Last active Jul 17, 2021
IPython/Jupyter Notebook enlarge/change cell width
from IPython.display import display, HTML
div#notebook-container { width: 95%; }
div#menubar-container { width: 65%; }
div#maintoolbar-container { width: 99%; }
mblondel /
Created May 22, 2015
Einstein sum notation
import numpy as np
rng = np.random.RandomState(0)
print "Trace"
A = rng.rand(3, 3)
print np.trace(A)
print np.einsum("ii", A)
bitops / hipchat.el
Last active Nov 14, 2019
HipChat + jabber.el
View hipchat.el
;; use jabber-connect to connect. Make sure you tab to select the hipchat account if it's the ;;
;; only connection configured. ;;
;; ;;
;; a fork of ;;
;; ;;
;; shout out to ;;
;; for the help. ;;
;; ;;
;; you can look up the necessary jabber info on the account i
NicolasT / Conc.lhs
Last active May 25, 2017
Deriving Typeclass Instances using Typed Holes
View Conc.lhs
# Deriving Typeclass Instances using Typed Holes
> module Conc where
> import Control.Applicative
We're presented with the following structure:
> data Concurrent a = Concurrent ((a -> Action) -> Action)
> data Action = Atom (IO Action)
> | Fork Action Action
davidfraser / uninstall-evernote-cleanup
Created Dec 29, 2014
Script to cleanup an Evernote installation under Wine, in order to allow reinstallation - see
View uninstall-evernote-cleanup
echo first uninstall evernote using the wine uninstaller
wine uninstaller
echo now searching forregistry entry to remove
cd ~/.wine/drive_c/windows/profiles/$USER/temp
upgrade_code="`grep 'with upgrade code' EvernoteSetup.log | tail -n 1 | sed 's/^.*with upgrade code {\([A-Fa-f0-9-]*\).*$/\1/'`"
reverse_upgrade_code="`python -c "x='${upgrade_code}' ; y = x[:18].split('-') ; x = x.replace('-', '') ; z = [a+b for a, b in zip(x[16::2], x[17::2])] ; print ''.join(''.join(reversed(part)) for part in y+z).upper()"`"
echo please use regedit to navigate to '\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\' and remove the key "$reverse_upgrade_code"
wine regedit