See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
(R. Hendricks 112) int index = 0; | |
(R. Hendricks 113) while (!element.equals(sortedList.get(index)) | |
(R. Hendricks 114) && sortedList.size() > ++index); | |
(R. Hendricks 115) return index < sortedList.size() ? index : -1; |
import sys | |
import json | |
from datetime import datetime | |
def fixup_str(text): | |
return text.encode('latin1').decode('utf8') | |
def fixup_list(l): |
import { EditorState } from 'prosemirror-state' | |
import { EditorView } from 'prosemirror-view' | |
import { | |
defaultMarkdownParser, | |
defaultMarkdownSerializer, | |
schema, | |
} from 'prosemirror-markdown' | |
import { exampleSetup } from 'prosemirror-example-setup' | |
import 'prosemirror-view/style/prosemirror.css' |
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior! | |
# disable the default submodule logic | |
git: | |
submodules: false | |
# use sed to replace the SSH URL with the public URL, then init and update submodules | |
before_install: | |
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules | |
- git submodule update --init --recursive |
# noemoji.pl | |
# | |
# Replace annoying emojis. You can see them on slack, for example. | |
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '1.0'; |
*.pot diff=msgcat | |
*.po diff=msgcat |
#!/bin/bash | |
# WebSocket shell, start & browse to http://<Host>:6655/ | |
# Requires bash 4.x, openssl. | |
# Author: [email protected] (which isn't me, apk) | |
coproc d { nc -l -p 6656 -q 0; } | |
nc -l -p 6655 -q 1 > /dev/null <<-ENDOFPAGE | |
HTTP/1.1 200 OK | |
<html><head><script language="javascript"> | |
var url = location.hostname + ':' + (parseInt(location.port) + 1); |
Objective: Print the lyrics for the current playing song.
How: We'll create a small bash
script to do the fetching for us (using curl
) and then we'll
display it either in the terminal or in our $EDITOR
First we'll need to get the name of the current song and its artist:
#!/bin/sh | |
# Arg: path/to/module/in/cvs | |
# Run git-cvsimport and place result in subdir cvs.path.to.module.in.cvs | |
# or update git repo there if already existing (incremental fetch should work) | |
# Fix to your cvs credentials | |
p="$1" | |
d="cvs.`echo $p | tr / .`" | |
test -d "$d" || mkdir "$d" | |
cd "$d" || exit 1 | |
git cvsimport -p x -v -k -a -d :pserver:me@cvshost:/opt/cvs "$p" |