This file contains hidden or 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
# This won't work in PS1, as inside PS1, newlines | |
# in command substitutions are handled specially. | |
# Hence, using PROMPT_COMMAND instead. | |
__conditional_newline() { | |
IFS='[;' read -rsd R -p $'\e[6n' _ _ col | |
if [ -n "$col" ] && [ "$col" -gt 1 ]; then | |
echo -e "\033[01;31m\\missing newline\033[00m" | |
fi | |
} |
This file contains hidden or 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 python | |
import i3ipc | |
import pgi | |
pgi.require_version('Notify', '0.7') | |
from pgi.repository import Notify | |
i3conn = i3ipc.Connection() | |
Notify.init('Urgent!') |
This file contains hidden or 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
var _ = require('lodash'), | |
fs = require('fs'), | |
path = require('path'), | |
csv = require('csv'), | |
Sequelize = require('sequelize'); | |
function addUser(db, filename, rolesByName, addresses) { | |
var parser = csv.parse({}, function (err, data) { | |
db.models.User.bulkCreate( | |
_.map(data, function (record, index) { |