Skip to content

Instantly share code, notes, and snippets.

@ivanov
ivanov / mpl_gradient_hack.py
Created April 22, 2013 23:21
gradient lines in matplotlib
#!/usr/bin/env python
"""A quick hack to draw gradient lines using a colormap.
This was written in response to <Baribal>'s question on IRC.
There are two functions provided here:
`plot_gradient_hack` takes two arguments, p0 and p1, which are both (x,y)
pairs, and plots a gradient between them that spans the full colormap.
@ivanov
ivanov / Twitter Privacy Policy
Last active May 20, 2020 05:53
Twitter 2020-05-19 TOS / PP update
Privacy Policy
Download PDF
Download PDF
Information You Share With Us
Additional Information We Receive About You
Information We Share and Disclose
Managing Your Personal Information With Us
Children and Our Services
@ivanov
ivanov / dropnewline.idr
Created April 18, 2018 05:49
The many ways of dropping trailing new lines in Idris
-- In Idris, fGetLine returns a string with a trailing newline. Here are
-- various ways of getting rid of it. I'm hoping I missed something more
-- straighforward. In all of the functions below, I'm assuming there is
-- exactly one '\n' character and that it occurs at the end of the string.
module Main
dropNewline0 : (x : String) -> String
dropNewline0 x =
fst $ break (== '\n') x
@ivanov
ivanov / EULA.txt
Last active April 11, 2020 02:18
Netscape 6.01 EULA + README.TXT (2001)
NETSCAPE 6 END-USER LICENSE AGREEMENT
Redistribution Or Rental Not Permitted
These terms apply to Netscape 6.
BY CLICKING THE ACCEPTANCE BUTTON FOR THE NETSCAPE 6 SOFTWARE
(THE "PRODUCT"), YOU ARE CONSENTING TO BE BOUND BY AND BECOME
A PARTY TO THIS AGREEMENT AS THE "LICENSEE."
IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT,
Deepnote
Our story
Join the team
Documentation
Privacy Policy
Effective date: January 1, 2019
# A template to demonstrate why we need to profile
# This instance written by Paul Ivanov (XXX: put your name / github id here)
def where_is_the_bottleneck(x):
pass
def could_be_this_one(x, y):
pass
def or_this_one(x):
@ivanov
ivanov / git-recheckout
Created November 7, 2013 20:16
Your local checkout of a branch, and the remote branch it tracks are out of sync. You want to check it out again, discarding your version of the branch.
#!/bin/bash
# git-recheckout: git reset to the upstream branch
#
# Your local checkout of a branch, and the remote branch it tracks are out of
# sync. You want to check it out again, discarding your version of the branch.
#
# Because you need to know the remotename/branchname string to reset to
#
# 1. get the remotename/the-branch combination
# 2. git reset remotename/the-branch
@ivanov
ivanov / git-recent
Created September 5, 2013 02:49
prints the recent heads from a remote
#!/bin/bash
# git-recent: prints the recent heads from a remote
#
# Usage:
#
# git recent # recent branches in this repo
# git recent remote_name # recent branches in remote_name
#
# git-recent was written by Paul Ivanov. Please send improvements to @ivanov on
# GitHub/Twitter, or find my email address.
@ivanov
ivanov / example.aux
Last active December 20, 2015 19:19 — forked from astrofrog/example.ipynb
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\zref@newlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.