# install brew from brew.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install gedit
brew install gedit
# link libpeas
brew link libpeas@1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on: http://nayuki.eigenstate.org/page/how-to-implement-the-discrete-fourier-transform | |
#include <iostream> | |
#include <vector> | |
#include <complex> | |
#include <cmath> | |
#include <cstdlib> | |
using namespace std; | |
vector<complex<double> > compute_dft(vector<complex<double> > in) { | |
int n = in.size(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This will list all manually installed packages without: dependencies, uninstalled packages, packages installed during system installation. | |
unopts() { | |
echo "`cat`" | sed -r 's/ --[^ ]+//g;s/ -[^ ]+//g' | |
} | |
list() { | |
cat '/var/log/apt/history.log' | | |
grep --color=never -v '\-o APT::Status-Fd=4 \-o APT::Keep-Fds::=5 \-o APT::Keep-Fds::=6' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Information is stored in ~/.packages | |
# Usage: install [-a|--as filename] packages | |
# uninstall filename | packages | |
install() { | |
mkdir -p ~/.packages | |
as= | |
force= | |
set -- `getopt -l as: a:f $@` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Useful when using `set mark-symlinked-directories on` in inputrc | |
# Install trash-cli first or replace `trash` with `rm -rf` | |
r() { | |
for arg | |
do | |
s=${#arg} | |
arg2=${arg:0:s-1} | |
if [ -L "$arg2" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book { | |
private int mPages; | |
public Book(int pages) { | |
mPages = pages; | |
} | |
public String toString() { | |
return String.format("This book has %d pages.", mPages); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./ruby/a.rb | |
require_relative 'b' | |
class B; end | |
class A | |
@b = B.new | |
end | |
./ruby/main.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GDK_PIXBUF_MODULEDIR=/usr/local/Cellar/gdk-pixbuf/2.36.0_2/lib/gdk-pixbuf-2.0/2.10.0/loaders | |
GDK_PIXBUF_MODULE_FILE=${GDK_PIXBUF_MODULEDIR}.cache | |
(export GDK_PIXBUF_MODULEDIR && export GDK_PIXBUF_MODULE_FILE && gdk-pixbuf-query-loaders --update-cache) | |
brew install gnome-icon-theme | |
brew upgrade homebrew/gui/klavaro | |
brew tap beeftornado/rmtree && brew install beeftornado/rmtree/brew-rmtree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
# Pulls random text from given directory. | |
set argc (count $argv) | |
if [ $argc -ne 1 ] | |
set d (pwd) | |
else | |
set d $argv[1] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funcs = %w(do re mi fa so la si 𝕕o) | |
# funcs = %w(Do Re Mi Fa So La Si do re mi fa so la si 𝕕o) | |
intervals = funcs.permutation(2) | |
puts "Functions count: #{funcs.length}" | |
puts "Permutation count: #{intervals.to_a.length}" | |
last = nil | |
intervals.each do |a, b| | |
if last != a then | |
last = a |