Skip to content

Instantly share code, notes, and snippets.

@mkideal
mkideal / terminal.go
Last active May 7, 2020 09:04
demo terminal app
package xyz
import (
"io"
"os"
"golang.org/x/crypto/ssh/terminal"
)
type readerWriter struct {
io.Reader
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@olexandr-konovalov
olexandr-konovalov / homophony.g
Last active December 16, 2015 04:48
Homophonic quotients of free groups
# This file contains the GAP input needed to verify the result of the paper
# Mestre, Jean-François; Schoof, René; Washington, Lawrence; Zagier, Don
# Quotients homophones des groupes libres. (French) [Homophonic quotients of
# free groups] Experiment. Math. 2 (1993), no. 3, 153--155
# (http://eudml.org/doc/233741) with respect to the English language.
F:=FreeGroup("a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z");
AssignGeneratorVariables(F);
@lucasdavila
lucasdavila / fixup.txt
Last active December 20, 2023 12:00
Fixing mac os yosemite issue "bash: fork: Resource temporarily unavailable"
# see the current limits
$ sysctl -a | grep maxproc
# increase it
$ sudo sysctl -w kern.maxproc=xxxx
$ sudo sysctl -w kern.maxprocperuid=xxx
# run at startup
$ sudo vim /etc/sysctl.conf
@srenatus
srenatus / WHY.md
Created October 14, 2014 14:20
minimal cabal config for stackage

With only line #1, you end up with cabal update returning

Downloading the latest package list from stackage
cabal: fromFlag NoFlag. Use fromFlagOrDefault
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active June 20, 2024 18:28
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@wch
wch / pairlist.R
Last active June 8, 2018 19:56
car, cdr, and push for pairlists in R
library(inline)
library(microbenchmark)
car <- cfunction(c(x = "pairlist"), '
if (x == R_NilValue)
return R_NilValue;
if (TYPEOF(x) != LISTSXP)
error("x must be a pairlist");
return CAR(x);
')
anonymous
anonymous / herd.R
Created June 1, 2014 04:02
Simulation of herd immunity
herd<-function(vaccination.fraction,arrival.rate=1/30,end.of.time=365,frequent.flyers=0.01,annoying.beep=TRUE){
N<-10000
xy<-matrix(runif(2*N),nrow=N,ncol=2)
status<-1+rbinom(N,1,vaccination.fraction)
startstat<-status
par(mar=c(1,1,3,1))
@chiral
chiral / torus.R
Created April 4, 2014 04:08
Test program for "pHom" package which can calculate persistent homologies in R
library(phom)
library(scatterplot3d)
N <- 20
R <- 25
r <- 10
sd <- 1
ts <- seq(0,2*pi,pi/N)
ps <- seq(0,2*pi,pi/N)
library(quantmod)
getSymbols( c("LNU00000012", "LNS12000091"), src="FRED" )
plot(diff(LNU00000012, lag=12*5)*1.93+ 385.70445)
lines(lag(diff(LNS12000091, lag=12*5), k=-12*20), col="blue", lty=4)
points(last(na.omit(lag(diff(LNS12000091, lag=12*5), k=-12*20))), pch=16, col="blue")
legend("topright", c("5y Demographic projection of Growth of 35-44 employees", "5y Actual Growth of 35-44 employees"), col=c("black", "blue"), lty=c(1, 4), cex=.6)