Skip to content

Instantly share code, notes, and snippets.

View aluxian's full-sized avatar

Alexandru Rosianu aluxian

View GitHub Profile
@aluxian
aluxian / md_colors.xml
Last active August 29, 2015 14:16
Material Design Colours for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- MD: Red -->
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
@aluxian
aluxian / install.sh
Last active May 27, 2018 19:45
Install image on Hetzner's Rescue System
#!/bin/bash
installimage -a -n r.tweeather.aluxian.com -b grub -r yes -l 0 \
-i /root/.oldroot/nfs/install/../images/Ubuntu-1510-wily-64-minimal.tar.gz \
-p swap:swap:8G,/boot:ext3:1G,/:ext4:all -d sda,sdb \
-K /root/id_rsa.pub
@aluxian
aluxian / backup.sh
Last active September 4, 2017 23:01
Whitelist for Dropbox CLI selective sync + backup script + DockerCloud stackfile
#!/bin/sh
echo "Backing up data folders"
for i in *; do
echo "Archiving $i to .dropbox/data/Tutum/$i.tar.gz ..."
tar -cf - "$i" | gzip -9 - > ".dropbox/data/Tutum/$i.tar.gz"
done
echo "Done"
@aluxian
aluxian / keybase.md
Last active August 30, 2017 07:18
Keybase verification gist

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@aluxian
aluxian / git_fzf_key_bindings.fish
Last active December 9, 2023 19:34 — forked from junegunn/functions.sh
Key bindings for git+fzf ported to Fish shell https://junegunn.kr/2016/07/fzf-git/
function __git_fzf_is_in_git_repo
command -s -q git
and git rev-parse HEAD >/dev/null 2>&1
end
function __git_fzf_git_status
__git_fzf_is_in_git_repo; or return
git -c color.status=always status --short | \
fzf -m --ansi --preview 'git diff --color=always HEAD -- {-1} | head -500' | \
cut -c4- | \
@aluxian
aluxian / convert.sh
Created December 20, 2018 17:48
Extract clean text from webpage w/ Mercury API and save to PDF
#!/bin/bash -e
APIURL="https://mercury.postlight.com/parser"
APIKEY="ErUeufK8WIFsi6769SZuQEEn1b6CS4D5JAfrvBhJ"
URL="$1"
TEMPDIR=$(mktemp -d)
# change working dir
cd $TEMPDIR
@aluxian
aluxian / GeneralURLCleaner.user.js
Last active September 26, 2021 17:55
AdGuard user scripts and filters
// ==UserScript==
// @run-at document-start
// @name General URL Cleaner
// @namespace https://greasyfork.org/en/scripts/10096-general-url-cleaner
// @description Cleans URL's from various popular sites.
// @downloadURL https://gist.github.com/aluxian/090326a5cdc2af46620a9e4f81b62830/raw/GeneralURLCleaner.user.js
// @updateURL https://gist.github.com/aluxian/090326a5cdc2af46620a9e4f81b62830/raw/GeneralURLCleaner.user.js
// @include https://www.youtube.com/*
// @include https://www.imdb.com/*
// @include https://www.facebook.com/*
@aluxian
aluxian / Install.txt
Created March 30, 2020 19:59 — forked from soderlind/Install.txt
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
@aluxian
aluxian / accounting.sql
Created April 14, 2020 07:04 — forked from 001101/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
function fish_user_key_bindings --description 'Custom key bindings'
bind \cs pet_select
bind \cr fzf_history_reverse_search
end