Skip to content

Instantly share code, notes, and snippets.

@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>
@Happy-Ferret
Happy-Ferret / feh_or_browser.lua
Created June 15, 2018 15:17 — forked from Donearm/feh_or_browser.lua
Open a url with feh, if it leads to an image, or firefox, in all other cases
#!/usr/bin/env lua
---
-- @author Gianluca Fiore
-- @copyright 2012, Gianluca Fiore <[email protected]>
--
--
-- Open a url with feh, if it leads to an image, or firefox, in all
-- other cases. Trivial but very useful with cli newsreaders (like
-- newsbeuter) to quickly preview images and to not have to switch to
@Happy-Ferret
Happy-Ferret / session_manager_setup.sh
Created June 15, 2018 08:33 — forked from awilhite/session_manager_setup.sh
Start Chrome OS With Flags. Overide Existing File in /sbin/session_manager_setup.sh
#!/bin/sh
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Set up to start the X server ASAP, then let the startup run in the
# background while we set up other stuff.
XAUTH_FILE="/var/run/chromelogin.auth"
MCOOKIE=$(head -c 8 /dev/urandom | openssl md5) # speed this up?
@Happy-Ferret
Happy-Ferret / crouton.conf
Created June 11, 2018 19:37 — forked from DennisLfromGA/crouton.conf
A ChromeOS upstart script to kick-off a crouton chroot desktop environment.
# Copyright (c) 2016 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
## Filename: /etc/init/crouton.conf
## NOTE: 'rootfs' verification needs to be removed.
## crouton chroot - Start session
##
## This will start a (crouton) chroot Desktop Environment session
@Happy-Ferret
Happy-Ferret / _README.md
Created June 7, 2018 05:37 — forked from morganrallen/_README.md
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@Happy-Ferret
Happy-Ferret / delete_git_submodule.md
Created April 25, 2018 15:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule