Skip to content

Instantly share code, notes, and snippets.

@padde
padde / gist:2623647
Created May 6, 2012 18:23
Convert video for PowerPoint with ffmpeg
ffmpeg -i INFILE -r 25 -f mpeg -vcodec mpeg1video -ar 48000 -b 1500k -acodec mp2 -ar 44100 -ac 1 -y OUTFILE.mpg
@padde
padde / c9-elixir.sh
Last active June 1, 2023 02:09
Install Script for Erlang/Elixir/Phoenix on Cloud9
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/padde/3c6301f15cbd5025e131740dae33aa95/raw/c9-elixir.sh)
#
# 3. There is no step 3!
@padde
padde / sidekiq_retry_schedule.rb
Last active April 19, 2023 15:31
Sidekiq retry schedule
require 'active_support/duration'
offset = 0
puts "attempt 0 immediately"
0.upto(24) do |count|
# https://github.com/mperham/sidekiq/blob/v6.1.2/lib/sidekiq/job_retry.rb#L225
average_jitter = (15 * (count + 1))
delay = count**4 + 15 + average_jitter
@padde
padde / install_tomato.sh
Created April 1, 2012 18:28
Install Tomato Firmware via TFTP from *NIX system
#!/bin/bash
echo "==================================================================="
echo "This bash script will upload tomato.trx in the current directory to"
echo "192.168.11.1 during the router's bootup."
echo
echo "* Set your ethernet card's settings to:"
echo " IP: 192.168.11.2"
echo " Mask: 255.255.255.0"
echo " Gateway: 192.168.11.1."
@padde
padde / gist:2628262
Created May 7, 2012 15:05
Ruby Fixnum each_bit
class Fixnum
def each_bit
8.times do |p|
yield (self & 1 << p) >> p
end
end
end
@padde
padde / DefaultKeyBinding.dict
Created November 11, 2011 16:45
Disable non-breaking space (Alt+Space) on OS X
# in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"~ " = ("insertText:", " ");
}
@padde
padde / SSH-Remote-Port-Forwarding.markdown
Last active September 8, 2022 06:03
SSH Remote Port Forwarding

!!! WIP !!!

SSH Remote Port Forwarding

TODO: intro

Provision Server

  • DigitalOcean
  • 512 MB RAM
@padde
padde / export-plot-as-csv.m
Created June 19, 2012 11:56
Mathematica: Export Plot Values as CSV
plot = Plot[Cos[x],{x,0,2\[Pi]}];
mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1];
Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"];
@padde
padde / keybase_proof.md
Created April 5, 2019 09:09
Keybase proof

Keybase proof

I hereby claim:

  • I am padde on github.
  • I am padde (https://keybase.io/padde) on keybase.
  • I have a public key ASAEolg38G1AcHEJA02qn5GcHNIM5025SKK7qMthoGn4RAo

To claim this, I am signing this object:

# Patrick Oscity
#
# Bauhaus-Universität Weimar
# Fakultät Medien
# SoSe 2011
require 'rubygems'
require 'wavefile'