This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from functools import reduce | |
from multiprocessing import Pool | |
from operator import itemgetter | |
def factors(n): | |
return set(reduce(list.__add__, | |
([i, n//i] for i in range(1, int(n**0.5) + 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack script --resolver lts-10.5 | |
{-# LANGUAGE DeriveFunctor #-} | |
import Data.List | |
import Control.Comonad | |
import System.Random | |
import System.Environment | |
data Zipper a = Zipper [a] a [a] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# This script is a simple wrapper which prefixes each i3status line with custom | |
# information. It is a python reimplementation of: | |
# http://code.stapelberg.de/git/i3status/tree/contrib/wrapper.pl | |
# | |
# To use it, ensure your ~/.i3status.conf contains this line: | |
# output_format = "i3bar" | |
# in the 'general' section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TPdevice=$( xinput | sed -nre '/Touchpad/s/.*id=([0-9]+).*/\1/p' ) | |
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" ) | |
if [ "$state" -eq '1' ];then | |
xinput --disable "$TPdevice" | |
else | |
xinput --enable "$TPdevice" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
range←{-1-(⍳⍵)÷(⍵÷2)} ⍝ between ¯1 and 1 | |
grid←(range ∘.{⍺+0j1×⍵} range) | |
f←{⍺+⍵*2} | |
iter←{⍵ (f⍣⍺) 0} ⍝ ⍺ is the number of iterations | |
mandelbrot←{2 > | ⍺ iter 2 × grid ⍵} ⍝ ⍺ is still the number of iterations, ⍵ is the resolution of the grid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Eigenvalues of a 2000×2000 random matrix from the Ginibre ensemble | |
┌────────────────────────────────────────┐ | |
1.5 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢀⡄⣠⣤⢤⣧⣄⡤⡠⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⣐⢔⡾⣿⠳⡽⣯⢿⢷⡯⡿⣹⡽⣿⣽⢾⣰⣠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⠀⠠⣰⡺⣽⣷⢏⣶⢽⣻⣻⣫⣿⡯⣿⢟⡿⣿⢿⣟⣯⣺⢷⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⣀⣿⣻⡟⣷⣷⡕⣛⢯⢾⣾⠯⢾⣿⡷⣝⣯⡯⣷⣋⢟⣿⣟⣿⢳⣀⠀⠀⠀⠀⠀⠀⠀│ | |
│⠀⠀⠀⠀⠀⠀⠀⢿⡯⣿⣷⡵⣷⣪⣿⣷⣫⢯⡾⡽⣿⡜⣿⡷⣕⡿⣟⣿⣻⣳⡿⣽⣋⡆⠀⠀⠀⠀⠀⠀│ | |
│⠤⠤⠤⠤⠤⠤⢼⣿⣿⣿⢽⣯⡯⢿⣾⢽⡿⣽⢽⣽⡿⢷⡿⢿⣵⣿⣽⣿⢮⢿⣯⣧⣿⠥⠤⠤⠤⠤⠤⠤│ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra | |
using Distributions | |
using Plots | |
plotly() | |
m(x) = 0.25*x^2 | |
k(x,y) = exp(-0.5 * (x-y)^2) | |
xmin = -5 | |
xmax = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ProgressMeter | |
using Plots | |
plotly(size=(500,500)) | |
function updatesandpile!(d, i, j) | |
n = get(d, (i,j), 0) | |
if n >= 4 | |
d[(i-1,j)] = get(d, (i-1,j), 0) + 1 | |
d[(i+1,j)] = get(d, (i+1,j), 0) + 1 | |
d[(i,j-1)] = get(d, (i,j-1), 0) + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
BEGIN { | |
FS = "\t"; | |
} | |
$2 ~ "^" ARGV[2] "$" { | |
count++; | |
if (count > 10) | |
exit; |
OlderNewer