Skip to content

Instantly share code, notes, and snippets.

@arvids
arvids / PKGBUILD
Last active December 3, 2017 17:59
polybar PKGBUILD
The polybar package has been updated so this is no longer needed.
mv ImageForLoginWallpaper.png /Library/Caches/com.apple.desktop.admin.png
#!/bin/bash
# Packages required
# dosfstools parted
# Can be run on any Linux system
# loop.max_part=15 must be in kernel cmdline (cmdline.txt for rpi)
# then reboot
echo "creating image to fit on 2Gb card"
dd if=/dev/zero of=arch-rpi.img bs=1M count=1850
@arvids
arvids / ppmi.py
Created March 29, 2014 11:43
Positive Pointwise mutual information
from scipy import sparse
import numpy
from itertools import izip, repeat
from multiprocessing import Pool
def ppmi(matrix,np,n):
if not sparse.isspmatrix_coo(matrix):
matrix = matrix.tocoo()
M,N = matrix.shape
data = matrix.data