Skip to content

Instantly share code, notes, and snippets.

module RndCrap where
import System.Random
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
boxm :: Float -> Float -> (Float, Float)
boxm u v = (r*cos(t), r*(sin(t)))
where r = sqrt (-2 * log u)
t = 2*pi*v
@myyc
myyc / my.emacs
Last active August 29, 2015 13:57
(global-linum-mode t)
(setq prelude-guru nil)
(setq mac-option-modifier 'nil)
(setq mac-right-option-modifier 'nil)
(setq mac-right-command-modifier 'meta)
(define-key smartparens-mode-map (kbd "C-<left>") 'backward-word)
(define-key smartparens-mode-map (kbd "C-<right>") 'forward-word)
PROMPT='%{$fg[magenta]%}★ %B%c%b $(git_prompt_info)% %{$fg[white]%}> %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}#%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[green]%} "
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
unbind C-v
@myyc
myyc / .zshrc
Last active December 22, 2019 12:09
source ~/.zplug/init.zsh
zplug "lib/git", from:oh-my-zsh
zplug "lib/history", from:oh-my-zsh
zplug "plugins/colored-man-pages", from:oh-my-zsh, defer:2
zplug "zsh-users/zsh-history-substring-search", defer:2
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions", defer:2
#!/usr/bin/env python
from __future__ import print_function
import sys
import platform
import os.path
import os
import subprocess
from distutils import spawn
#!/usr/bin/env zsh
log=/tmp/pybs.log
pip=/opt/local/bin/pip3.6
pkgs=("pip" "numpy" "scipy" "pandas" "matplotlib" "seaborn")
autoload -Uz colors && colors
function y() {
echo "[$fg[$1]$2$reset_color]\t"
@import url("base.css"); /* Happy16 Light theme */
body {background-color: #f9f9f9;}
.container { min-width:60% !important; }
.output_svg div {
width: 100% !important;
height: 100% !important;
}
@myyc
myyc / f.py
Created November 1, 2016 14:56
from functools import wraps
def c(f):
@wraps(f)
def w(k):
if k in d:
return d[k]
else:
d[k] = f(k)
return d[k]
@myyc
myyc / ucldraw.py
Last active December 8, 2017 13:14
chelsea is 66.667% fucked
import pandas as pd
import numpy as np
import seaborn as sns
from ipywidgets import interact, RadioButtons as RB
fs = [("Barcelona", "ESP","D"), ("Beşiktaş", "TUR","G"),
("Liverpool", "ENG","E"),
("City", "ENG","F"), ("Man U", "ENG","A"),
("PSG","FRA","B"), ("Roma", "ITA","C"),
("Tottenham", "ENG","H")]