Skip to content

Instantly share code, notes, and snippets.

@apk
apk / do-cvs-fetch
Created April 14, 2010 06:55
Import cvs tree into git repo
#!/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"
@febuiles
febuiles / songs.md
Last active July 1, 2022 03:45
Fetching lyrics in Unix

Fetching lyrics in the command line

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

Get the current song

First we'll need to get the name of the current song and its artist:

@apk
apk / websock.sh
Created April 18, 2012 15:51
A web socket server as a bash script.
#!/bin/bash
# WebSocket shell, start & browse to http://<Host>:6655/
# Requires bash 4.x, openssl.
# Author: rootshell@corelogics.de (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);
@alikins
alikins / .gitattributes
Created October 7, 2014 14:02
po/pot file attributes for textconf and diff (ie, make git diff on gettext files less useless)
*.pot diff=msgcat
*.po diff=msgcat
@Ajnasz
Ajnasz / noemoji.pl
Created October 14, 2014 11:53
# Replace annoying emojis. You can see them on slack, for example.
# 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';
@petrbel
petrbel / .travis.yml
Last active October 26, 2019 10:29 — forked from iedemam/gist:9830045
Travis-CI submodules
# 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/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 4, 2024 17:49
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Are you having a good day today?
Be gentle with yourself today.
Breakfast and lunch are as important as dinner, so please don't skip them!
Checking privilege...
Congratulate yourself for doing difficult things, even if they might not seem difficult to others.
Do you have a glass of water nearby? Time for a sip!
Don't be afraid to offer hugs. Someone probably needs them.
Don't compare yourself to others, they are not you! You are unique!
Don't forget to eat breakfast! It's important fuel for every adventure.
Go get a drink of water. Stay hydrated!
@mbrehin
mbrehin / prosemirror.js
Created January 26, 2018 08:59
Prosemirror example: replacing form textareas
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'
@multun
multun / message_json_parser.py
Created December 26, 2018 22:51
Pretty-print a facebook message.json, fixing up broken encoding
import sys
import json
from datetime import datetime
def fixup_str(text):
return text.encode('latin1').decode('utf8')
def fixup_list(l):