Skip to content

Instantly share code, notes, and snippets.

View f0t0n's full-sized avatar

Eugene Naydenov f0t0n

View GitHub Profile
@mvoropaiev
mvoropaiev / newsbeuter-notify.sh
Last active February 10, 2017 12:26
little script for newsbeuter desktop notifications
#!/usr/bin/env bash
exec notify-send \
--hint="int:transient:1" \
--icon="rss" \
--app-name="newsbeuter" \
"newsbeuter" "$@"
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mvoropaiev
mvoropaiev / fedora.sh
Last active December 27, 2016 08:44
some useful fedora 23 install cmds
#!/usr/bin/env bash
set -ex
## update system
sudo dnf upgrade --assumeyes --refresh
## fstrim (on luks, no lvm)
# 1. add 'rd.luks.options=discard' to /etc/default/grub (at the end of `GRUB_CMDLINE_LINUX="... rd.luks.options=discard"`)
# 2. run 'sudo grub2-mkconfig -o /boot/grub2/grub.cfg'
# 3. add `luks,allow-discards` too all encrypted volumes in /etc/crypttab (at the end of line)
(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
@keis
keis / coro.py
Created April 14, 2014 08:27
asyncio examples
import asyncio
@asyncio.coroutine
def waiting(r):
print("hello from waiting -", r)
yield from asyncio.sleep(2)
print("bye from waiting -", r)
return r
@innotekservices
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh