Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@sliminality
sliminality / hide_code.py
Last active August 5, 2019 21:00
jupyter stuff
def hide_code():
from IPython.display import HTML
from IPython.display import display
# Taken from https://stackoverflow.com/questions/31517194/how-to-hide-one-specific-cell-input-or-output-in-ipython-notebook
tag = HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.cell.code_cell.rendered.selected div.input').hide();
@sliminality
sliminality / dependencies.ts
Last active February 4, 2020 05:50
Collection of useful TypeScript tricks
/**
* Script to extract dependency graph from a codebase with an entry point.
*/
import {
createCLICommand,
startIfMain,
runCommand,
createFlagMap,
t,
<style id="jsbin-css">
:root {
--color-dark: #333030;
--color-dark-grey: #9e9e9e;
--color-grey: #bec6ce;
--color-red: #f7b9b9;
--color-purple: #e0c6f4;
--color-blue: #bae2f4;
--color-yellow: #fcf8a4;
@sliminality
sliminality / erasing.md
Last active July 9, 2019 19:18
adventures in Flow typing

Erasing properties from objects

export type LearningTimeInfo = $ReadOnly<{|
    // The number of seconds offset from the learner UTC time to their
    // local time, to allow for in/out school detection.
    localTimeOffsetSeconds: {offsetSeconds: number},

    // The full URL.  Intended for debugging/human-readability.  Code
    // should not be analyzing this field to do things! -- instead we
@sliminality
sliminality / simple.tex
Created November 19, 2018 19:36
Simple document template for LaTeX
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,top=1.25in,headsep=0.25in]{geometry}
\usepackage{fancyhdr}
\title{Final Project Prospectus, HUM 325}
\author{Sarah Lim}
\date{February 2017}
\makeatletter
@sliminality
sliminality / puz.md
Created November 14, 2018 06:40
Documentation for the Across Lite *.puz format, reformatted from https://code.google.com/archive/p/puz/wikis/FileFormat.wiki
@sliminality
sliminality / pencilMode.js
Last active November 13, 2018 19:43
bind Ctrl-P to toggle pencil mode on and off in the NYT Crossword app
// make a bookmarklet here: https://mrcoles.com/bookmarklet/
const listener = ({key, ctrlKey}) => {
if (ctrlKey && key === 'p') {
$r.store.dispatch({
type: 'TOGGLE_PENCIL_MODE',
});
}
};
@sliminality
sliminality / .bashrc
Last active October 12, 2018 15:29
Problems and solutions encountered while developing in Ubuntu 18.04 on Windows
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
## Aliases
alias ..='cd ..'
alias ...='cd ../..'
alias lsa='ls -a'
alias ll='ls -la'
alias gs='git status'
"########################################
"########################################
" Rainbow Contrast (rainglow)
"
" https://github.com/rainglow/vim
"
" Copyright (c) Dayle Rees.
"########################################
"########################################
@sliminality
sliminality / dot-composition.md
Last active December 20, 2018 21:27
This gist is where I will post my weird and inefficient JavaScript metaprogramming experiments

Dot composition

f.g.h(x) === f(g(h(x)))

Example

const add1 = x =&gt; x + 1;