Skip to content

Instantly share code, notes, and snippets.

\begin{filecontents}{\jobname.bib}
@book{AAA,
title={{This is a long title to see if the hanging indent works
or if it fails, I'm guessing it will fail}},
author={John Smith},
publisher={MyPublishing},
year={2005}
}
\end{filecontents}
\documentclass{article}
import Data.Array.IO
import Data.Maybe
solver :: IOArray Integer Integer -> IO [Integer]
solver arr = do
idx <- getBounds arr
out <- newArray idx Nothing
solver' arr out idx
map fromJust <$> getElems out
@Zalastax
Zalastax / yt-mono-2-steroe.js
Created November 7, 2017 12:28
Make YouTube videos with mono sounds be stereo
// From https://stackoverflow.com/questions/20287890/audiocontext-panning-audio-of-playing-media
window.audioContext = window.audioContext||window.webkitAudioContext; //fallback for older chrome browsers
var context = new AudioContext();
context.createGain = context.createGain||context.createGainNode; //fallback for gain naming
var gainL = context.createGain();
var gainR = context.createGain();
var splitter = this.context.createChannelSplitter(2);
//Connect to source
@Zalastax
Zalastax / Dockerfile
Created January 6, 2017 22:54
Dockerfile to build librespot for arm v6+v7
FROM ubuntu:precise
RUN echo -n "foreign-architecture armhf" > /etc/dpkg/dpkg.cfg.d/multiarch
RUN sed -i 's/deb /deb [arch=amd64,i386] /g' /etc/apt/sources.list
RUN sed -i 's/deb-src /#deb-src /g' /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-security main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-updates main" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y gcc-arm-linux-gnueabihf libasound2:armhf libasound2-dev:armhf portaudio19-dev:armhf
RUN apt-get install -y gcc g++ git curl pkg-config libprotoc-dev file make
\documentclass{article}
\usepackage{xparse,array}
% From http://tex.stackexchange.com/a/286908
\ExplSyntaxOn
\NewDocumentCommand{\truthtable}{mm}
{
\group_begin:
\setlength{\arraycolsep}{0pt}
\usepackage{logicproof}
\newcommand{\pli}[1][]{\mathrm{i}#1 \:}
\newcommand{\ple}[1][]{\mathrm{e}#1 \:}
\newcommand{\plande}[1][]{\land \ple[_#1]}
\newcommand{\plandi}{\land \pli}
\newcommand{\plore}{\lor \ple}
\newcommand{\plori}[1][]{\lor \pli[_#1]}
\newcommand{\pltoe}{\to \ple}
\newcommand{\pltoi}{\to \pli}