Skip to content

Instantly share code, notes, and snippets.

View dangpzanco's full-sized avatar

Daniel Zanco dangpzanco

View GitHub Profile
@t-nissie
t-nissie / fib.jl
Last active May 31, 2021 22:14
Three ways of generating n-th Fibonacci number in Julia language
#!/usr/bin/env julia
# Gist: https://gist.github.com/t-nissie/641df996b9035f85b230
# Three ways of generating n-th Fibonacci number in Julia language
# Put perfutil.jl in the same directory as:
# wget https://raw.githubusercontent.com/JuliaLang/julia/master/test/perf/perfutil.jl
# Turn off garbage collection (GC), when you get occasional bad timings. See perfutil.patch below.
###
using Base.Test
include("perfutil.jl")
@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@smealum
smealum / bin2wav.py
Last active May 25, 2020 22:34
bangai-o soundhax
import sys
import wave
import struct
# bit0 is a single period sine wave at 1024Hz with a given amplitude
# bit1 is the same but with ~2.7 times the amplitude
bits = [[0x00, 0x09, 0x12, 0x1A, 0x21, 0x27, 0x2C, 0x2F, 0x30, 0x2F, 0x2C, 0x27, 0x21, 0x1A, 0x12, 0x09, 0x00, 0xF6, 0xED, 0xE5, 0xDE, 0xD8, 0xD3, 0xD0, 0xD0, 0xD0, 0xD3, 0xD8, 0xDE, 0xE5, 0xED, 0xF6], [0x00, 0x18, 0x30, 0x46, 0x59, 0x69, 0x75, 0x7C, 0x7F, 0x7C, 0x75, 0x69, 0x59, 0x46, 0x30, 0x18, 0x00, 0xE7, 0xCF, 0xB9, 0xA6, 0x96, 0x8A, 0x83, 0x81, 0x83, 0x8A, 0x96, 0xA6, 0xB9, 0xCF, 0xE7]]
bits[0] = [b^0x80 for b in bits[0]]
bits[1] = [b^0x80 for b in bits[1]]
bits[0] = struct.pack('%sB' % len(bits[0]), *bits[0])
@guiambros
guiambros / .XCompose
Last active September 26, 2022 18:15
.XCompose
#-#-#-#-#-#-#-#
# ~/.XCompose
# To change the US International keyboard layout to behave like the
# Microsoft Windows (TM) version of the layout
# version: 0.2 edit 6 (20110403-6)
# by @tamh [48bytes at gmail com]
#
# Released under LGPL v2.1. Please refer to it by going to:
# <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>
@ax3l
ax3l / CUDA_Compilers.md
Last active April 8, 2024 09:57
CUDA Compilers
<!DOCTYPE html>
<!-- saved from url=(0032)http://www.rodrigoghedin.com.br/ -->
<html lang="pt-BR"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Rodrigo Ghedin</title>
<link href="http://www.rodrigoghedin.com.br/css" rel="stylesheet" type="text/css">
<link href="http://www.rodrigoghedin.com.br/favicon.png" rel="shortcut icon" type="image/x-icon">
<meta name="description" content="Página pessoal de Rodrigo Ghedin.">
<meta name="keywords" content="rodrigo ghedin, ghedin, gizmodo, gemind, rodrigo, meio bit, winajuda, paranavaí, direito, faculdades maringá, uem, comunicação, maringá">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@grindars
grindars / steam_bootstrap.sh
Created December 7, 2012 07:53
Steam installer for Debian
#!/bin/bash
#
# Steam installer for Debian wheezy (32- and 64-bit)
#
# Place into empty directory and run.
#
download() {
local url="$1"
local filename="$(basename "$url")"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: