Skip to content

Instantly share code, notes, and snippets.

Avatar

Łukasz Wieczorek wieczorek1990

View GitHub Profile
@wieczorek1990
wieczorek1990 / fish_history
Created Aug 25, 2019
Zadanie domowe z fish shell
View fish_history
- cmd: cd ../Downloads/
when: 1566731069
paths:
- ../Downloads/
- cmd: wine Nexus.Mod.Manager-0.70.8.exe
when: 1566731071
paths:
- Nexus.Mod.Manager-0.70.8.exe
- cmd: cd ..
when: 1566731104
@wieczorek1990
wieczorek1990 / main.sh
Last active Aug 21, 2017
Klavaro on Mac OS
View main.sh
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
View solemnisation.rb
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
View random.fish
#!/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
@wieczorek1990
wieczorek1990 / circular_imports.txt
Last active May 20, 2016
Circular imports in Python & Ruby
View circular_imports.txt
./ruby/a.rb
require_relative 'b'
class B; end
class A
@b = B.new
end
./ruby/main.rb
View gist:0be73b853166dae14fb6472b42bd9194
### Keybase proof
I hereby claim:
* I am wieczorek1990 on github.
* I am wieczorek1990 (https://keybase.io/wieczorek1990) on keybase.
* I have a public key ASBwPnYkB-FuNuDOdogaiRZIEMD77_IrqQdGrkZeaQCT8wo
To claim this, I am signing this object:
@wieczorek1990
wieczorek1990 / Main.java
Last active May 5, 2016
Linked List in Java
View Main.java
class Book {
private int mPages;
public Book(int pages) {
mPages = pages;
}
public String toString() {
return String.format("This book has %d pages.", mPages);
}
@wieczorek1990
wieczorek1990 / r.sh
Last active Aug 29, 2015
Safe symbolic links removal
View r.sh
#!/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" ]
@wieczorek1990
wieczorek1990 / hapt.sh
Last active Aug 29, 2015
apt-get manually installed packages history
View hapt.sh
#!/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' |
@wieczorek1990
wieczorek1990 / mapt.sh
Last active Aug 29, 2015
Manually manage apt-get packages
View mapt.sh
#!/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 $@`