Skip to content

Instantly share code, notes, and snippets.

@mro
mro / fft.rb
Created April 4, 2011 23:46
Discrete Fast Fourier Transform from 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#!/usr/bin/env ruby
require 'complex'
class Array
# DFT and inverse.
#
# Algorithm from
# 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#
# See http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/
@DamianZaremba
DamianZaremba / vm_install.sh
Created August 14, 2011 23:05
virt-install wrapper
#!/bin/bash
#
# Little virt-install wrapper to save typing, supports the following:
# centos - Centos network install with optional ks
# fedora - Fedora network install with optional ks
# debian - Debian network install with optional ks
# ubuntu - Ubuntu network instal with option ks
# pxe - Boot a vm and tell it try PXE
#
# Setup:
@jsvnm
jsvnm / infrubystuff.el
Created November 24, 2011 08:24
making pry work with inf-ruby
(add-to-list 'inf-ruby-implementations '("pry" . "pry"))
(setq inf-ruby-default-implementation "pry")
(setq inf-ruby-first-prompt-pattern "^\\[[0-9]+\\] pry\\((.*)\\)> *")
(setq inf-ruby-prompt-pattern "^\\[[0-9]+\\] pry\\((.*)\\)[>*\"'] *")
@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 2, 2024 11:04
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
### Default script
$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%
### My script
$rreplace($replace($if2(%albumartist%,%artist%),...,...),\\.\$,$noop(.))/$if($if2(%originaldate%,%date%),[$left($if2(%originaldate%,%date%),4)] ,)$rreplace($replace(%album%,...,...),\\.\$,$noop(.))$if($gt(%totaldiscs%,1),\, CD $num(%discnumber%,1),)$if($gt($left(%date%,4),$left($if2(%originaldate%,%date%),4)), [Released %date%],)/$num(%tracknumber%,2) - $replace(%title%,...,...)
@deanrather
deanrather / .workstation.sh
Last active June 25, 2022 06:28
Configure Work Environment
#!/bin/bash
# Workstation Configurator
# To setup this script, run:
#
# wget -O ~/.workstation git.io/workstation && . ~/.workstation setup
#
# This achieves a few things:
# - Installation & Setup of Programs (Interactive)
# - Provides ~/.workstation file which automatically loads function library
@armeo
armeo / tmux.conf
Created January 31, 2014 04:33
Tmux Config
# Ctrl-b is a bad prefix key, use Ctrl-a instead
set-option -g prefix C-a
unbind-key C-b
# Also assign Ctrl-a to send the prefix to a remote session
bind-key C-a send-prefix
# Windows should be numbered from 1 like panes
set -g base-index 1
@lirenlin
lirenlin / gist:9892945
Last active April 21, 2024 17:27
i3 wm, hide window title bar
@teeparham
teeparham / rdoc2md.rb
Last active November 7, 2023 00:47
Convert rdoc to markdown
require 'rdoc'
converter = RDoc::Markup::ToMarkdown.new
rdoc = File.read(ARGV[0] || 'README.rdoc')
puts converter.convert(rdoc)
# ruby rdoc2md.rb > README.md
# ruby rdoc2md.rb ABC.rdoc > abc.md