This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# based on: | |
# https://gist.github.com/joel-wright/68fc3031cbb3f7cd25db1ed2fe656e60 | |
import os | |
import time | |
from pathlib import Path | |
from functools import lru_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sleep 1 | |
if [ -f ~/.brightness ] | |
then | |
read -r br < ~/.brightness | |
bri=`echo "${br} * 100" | bc -l | xargs printf "%.0f\n"` | |
echo $bri | |
if [ ${bri} -gt 100 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
path=/sys/class/backlight/intel_backlight | |
luminance() { | |
read -r level < "$path"/actual_brightness | |
factor=$((max / 100)) | |
ret=`printf '%d\n' "$((level / factor))"` | |
if [ $ret -gt 100 ]; then | |
ret=100 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Managing notes with fzf (https://github.com/junegunn/fzf) | |
# - CTRL-L: List note files in descending order by their modified time | |
# - CTRL-F: Search file contents | |
# | |
# Configuration: | |
# - $NOTE_DIR: Directory where note files are located | |
# - $NOTE_EXT: Note file extension (default: txt) |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# node-supervisor: https://github.com/isaacs/node-supervisor | |
# locomotive: http://locomotivejs.org/ | |
supervisor --watch app/controllers,config,config/environments,config/initializers -- node_modules/locomotive/bin/lcm.js server |