Skip to content

Instantly share code, notes, and snippets.

/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Happy-Ferret
Happy-Ferret / do to dot bin echo.sh
Created July 11, 2018 06:35 — forked from o-jasper/do to dot bin echo.sh
ln -s trick you can do with firejail, but with everything. In Python.
ln -s ~/.bin/lnstrick.py ~/.bin/echo
@Happy-Ferret
Happy-Ferret / ln_s_trick.py
Created July 11, 2018 06:35 — forked from o-jasper/ln_s_trick.py
Ln -s trick which am using. Could possibly use some features like supporting quotes, perhaps "patterns"
#!/bin/python
import sys
import subprocess
import os
import sys
from pathlib import Path
def figure_path_list():
got = os.getenv('LNS_TRICK_PATH')
// 1) Install Firebug
// 2) In a new browser window, open this URL:
// chrome://global/content/commonDialog.xul
// (It doesn't matter the particular .xul file you open, as long as it is a valid XUL file.)
// 3) Launch JavaScript Shell in Firebug
// 4) In the new shell window, type the following commands:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
@Happy-Ferret
Happy-Ferret / mojave.xml
Created June 28, 2018 07:46 — forked from trongthanh/mojave.xml
macOS Mojave dynamic background re-implement as GTK+ background slideshow. Background images are changed to reflect the time of the day.
<!-- Intruction:
- Download and unzip Mojave dynamic background here: https://files.rb.gd/mojave_dynamic.zip
- Fix the path to the background images
- Use gnome-tweaks tool to select this XML as wallpaper
-->
<background>
<starttime>
<year>2014</year>
<month>01</month>
<day>11</day>
@Happy-Ferret
Happy-Ferret / make_dock.sh
Created June 25, 2018 08:27 — forked from Airblader/make_dock.sh
Turn any window into a dock for i3 (caution, dock windows do not take focus ever)
#!/usr/bin/env bash
# call like this:
# /path/to/this/script.sh <window_id> <dock height>
win="${1:-}"
height="${2:-}"
width=$(xrandr -q | head -n1 | awk '{print $8}')
xdotool windowunmap --sync ${win}
xdotool windowsize --sync ${win} ${width} ${height}
@Happy-Ferret
Happy-Ferret / nodelike.swift
Created June 20, 2018 08:59 — forked from tkareine/nodelike.swift
Node.js like event-loop with libdispatch and Swift
#!/usr/bin/env xcrun swift
import Dispatch
let appQueue = dispatch_queue_create("org.tkareine.NodeLike.appQueue", DISPATCH_QUEUE_SERIAL)
let appGroup = dispatch_group_create()
func delay(delayInMS: Int, block: () -> Void) {
let delayInNS = Int64(delayInMS) * Int64(NSEC_PER_MSEC)
let scheduleAt = dispatch_time(DISPATCH_TIME_NOW, delayInNS)
@Happy-Ferret
Happy-Ferret / 0-install-nodejs-v9.sh
Created June 19, 2018 08:20 — forked from slavafomin/0-install-nodejs-v9.sh
Install latest version of Node.js in Ubuntu using bash shell script
#/usr/bin/env bash
set -o errexit
set -o pipefail
NODE_VERSION="v9"
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
. $HOME/.nvm/nvm.sh
@Happy-Ferret
Happy-Ferret / node-and-npm-in-30-seconds.sh
Created June 18, 2018 18:25 — forked from isaacs/node-and-npm-in-30-seconds.sh
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
<style type="text/css">
html {
cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64"><circle cx="32" cy="32" r="32" style="fill: red;"/></svg>')
}
</style>