Skip to content

Instantly share code, notes, and snippets.

View deeuu's full-sized avatar

Dominic Ward deeuu

View GitHub Profile
@WeirdConstructor
WeirdConstructor / RustAudioLinkCollection.md
Last active May 6, 2024 15:13
Rust Audio Link Collection

Weird Constructor's (slightly opinionated) Rust Audio Link Collection

@nanmu42
nanmu42 / pkcs7padding.go
Last active October 3, 2023 06:55
Golang PKCS7 Padding/Unpadding
// pkcs7strip remove pkcs7 padding
func pkcs7strip(data []byte, blockSize int) ([]byte, error) {
length := len(data)
if length == 0 {
return nil, errors.New("pkcs7: Data is empty")
}
if length%blockSize != 0 {
return nil, errors.New("pkcs7: Data is not block-aligned")
}
padLen := int(data[length-1])
@pfitzseb
pfitzseb / init.vim
Last active March 7, 2019 11:06
LanguageServer setup
call plug#begin('~/.config/nvim/plugged')
Plug 'JuliaEditorSupport/julia-vim'
Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
let g:deoplete#enable_at_startup = 1
" julia
let g:default_julia_version = '1.0'
@stedi67
stedi67 / elm.nim
Created July 20, 2018 09:58
karax using elm architecture
import patty
import strformat
import strutils
import sugar
include karax / prelude
include karax / kdom
include karax / kajax
type
# Default terminal
set-option -g default-terminal "screen-256color"
# Use vim key bindings
set-option -g mode-keys vi
set-option -g status-keys vi
# Turn the mouse on
set-option -g mouse on
@ed95
ed95 / juce_EmojiDefines.h
Last active November 29, 2019 19:49
C++/JUCE emoji defines
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
anonymous
anonymous / windscribe-connect-usable.sh
Created December 3, 2017 05:55
windscribe scan for decent server.
# Script that tries to find a windscribe vpn server with decent speeds
# Requires the windscribe command line client, and the speedtest.net
# python cli from here: https://github.com/sivel/speedtest-cli
#!/bin/bash
windscribe disconnect
speed=`speedtest --simple |grep -i download | cut -d ' ' -f 2`
@hagenw
hagenw / install_python_matlab_engine.sh
Created September 28, 2017 09:06
Install Matlab Engine API for python without root permissions
#!/bin/bash
# Go to $MATLABROOT/extern/engines/python and run the following line to build the python engine without root permissions.
# See https://uk.mathworks.com/help/matlab/matlab_external/install-matlab-engine-api-for-python-in-nondefault-locations.html
python setup.py build --build-base=$HOME/tmp/build install
@Necklaces
Necklaces / ufw_vpn_killswitch_tutorial.md
Last active February 28, 2024 22:13
GNU/Linux UFW VPN kill switch tutorial

GNU/Linux UFW VPN kill switch tutorial

This is a quick guide for setting up a kill switch using UFW (Uncomplicated FireWall). It is assumed you are using OpenVPN and optionally Network-Manager with network-manager-openvpn.

1. (Optional) IP Addresses

Before we can start we're going to need the IP address (or the IP addresses) of your VPN so that we can whitelist those later on, write them down. They are obviously going to be different for every VPN and VPNs with multiple servers, so I'll leave this up to you.

2. Install UFW

On some systems UFW is installed and enabled by default (Ubuntu, for example). Installation procedure is going to be different for every distribution of GNU/Linux, but it's usually something like

@svaksha
svaksha / pythontojulia.md
Created May 12, 2017 12:27 — forked from cuckookernel/pythontojulia.md
Python to Julia Quick translation / conversion reference Guide

A quick and dirty syntax translation / conversion reference guide to ease the transition between Python and Julia. This is not meant as a reference to the language. For that you should read the manual.

Some important differences

  • Arrays in Julia are indexed starting from 1.
  • In Julia classes (i.e. types) don't own methods. Methods are implementations of generic functions and are invoked in a "static style", i.e. instead of Python's str1.rstrip(), we will have rstrip( str1 ), instead of file1.close(), close( file1 ).

Some important similarities.