Skip to content

Instantly share code, notes, and snippets.

@andscoop
andscoop / init.lua
Last active March 17, 2024 14:12
a simple, single file init.lua for nvim
-- forked from https://github.com/nvim-lua/kickstart.nvim
-- TODO
-- system clipboard copy config (unnamedplus?)
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
@mkborregaard
mkborregaard / TraceCalls2.jl
Last active March 1, 2022 12:29
Create call trace graphs for julia calls. Based mostly on code and input by Tim Holy (https://github.com/cstjean/TraceCalls.jl/issues/61)
module TraceCalls2
using JuliaInterpreter, OrderedCollections, LightGraphs
const callchains = OrderedSet{Vector{Method}}()
const modules = Set{Module}()
function callchain(frame::JuliaInterpreter.Frame)
chain = Method[]
sc = JuliaInterpreter.scopeof(frame)
while sc isa Method
@aammd
aammd / bifurcation.jl
Created November 22, 2018 19:44
drawing a bifurcation diagram in Julia
using Plots
# a vector of r values
Rs=collect(0.1:0.001:3)
T = 5000
N=zeros(length(Rs), T)
#Set t0 values to 1
N[:,1] .= 1
@erdincay
erdincay / sugh.sh
Last active March 14, 2024 21:00
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
@sipa
sipa / golomb_loss.md
Last active July 30, 2023 18:25
Minimizing the redundancy in Golomb Codes Sets
@polonskiy
polonskiy / encrypted-git-repo.md
Created February 7, 2018 12:13
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@vermorel
vermorel / fast_convolve_1D.cpp
Last active April 10, 2024 12:31
Fast 1D convolution with AVX
// Fast 1D convolution with AXV
// By Joannes Vermorel, Lokad, January 2018
// Released under MIT license
#include <string.h>
#include <stdio.h>
#include <malloc.h>
/* A simple implementation of a 1D convolution that just iterates over
* scalar values of the input array.
#include <iostream>
#include <vector>
#include "tiny_dnn/tiny_dnn.h"
using namespace tiny_dnn;
using namespace tiny_dnn::activation;
using namespace tiny_dnn::layers;
int main()
{
@originalsouth
originalsouth / outline_type3.zsh
Last active July 21, 2017 15:00
Outline pdf images with type 3 fonts
#!/usr/bin/env zsh
if [[ $# -eq 0 ]]
then
echo 'outline_type3.zsh [option/files]'
echo 'options:'
echo "\t-f\ttoggle overwrite"
else
overwite=false
for file in "$@"
do
@originalsouth
originalsouth / nm.zsh
Created May 22, 2017 10:55
launch a command in the background and notify the user when it's done
#!/usr/bin/env zsh
main()
{
START=$(date +%s)
STARTT="$(date)"
OUT="$(mktemp nm.XXXXXXXXXX)"
echo "the launchpath was $(pwd) with pid $$" > $OUT
echo "the received output is:" >> $OUT
if [ "$1" = "-" ]
then