git clone <yourgisturl> <usefulname>
cd <usefulname>
- edit the
.git/config
to have the origin remote point atgit@gist.github.com:1234.git
rather than the https url. I'm sure there is a git remote add <name> <forkurl>
git fetch <name>
git merge <name>/master --no-ff
git push origin master
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
# | |
# Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. | |
# | |
import ctypes | |
import logging | |
import os | |
class ColorizingStreamHandler(logging.StreamHandler): | |
# color names to indices | |
color_map = { |
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
# bash completion for ctest(1) -*- shell-script -*- | |
_ctest() | |
{ | |
local cur prev words cword | |
_gst_init_completion -n = || return | |
case "$prev" in | |
-C|--build-config) | |
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo |
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 python | |
import datetime | |
date = datetime.date.today() | |
import sys | |
if len(sys.argv) > 1: | |
delta = datetime.timedelta(int(sys.argv[1])) | |
date += delta | |
print "%4d-%02d-%02d" % (date.year, date.month, date.day) |
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
# bash completion for homesick(1) -*- shell-script -*- | |
_castlelist() | |
{ | |
echo $(homesick list | awk '{print $1}') | |
} | |
_homesick() | |
{ | |
local cur prev words cword |
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
# bash completion for nanoc -*- shell-script -*- | |
_nanoc() | |
{ | |
local cur prev words cword | |
_gst_init_completion -n = || return | |
COMPREPLY=( $( compgen -W "compile create view" -- "$cur") ) | |
} && | |
complete -F _nanoc nanoc |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Simple calculator - from https://github.com/mathiasbynens/dotfiles/blob/master/.functions | |
function calc() { | |
local result="" | |
result="$(printf "scale=10;$*\n" | bc --mathlib | tr -d '\\\n')" | |
# └─ default (when `--mathlib` is used) is 20 | |
# | |
if [[ "$result" == *.* ]]; then | |
# improve the output for decimal numbers | |
printf "$result" | | |
sed -e 's/^\./0./' `# add "0" for cases like ".5"` \ |
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
# This script is based on one from | |
# https://forums.dropbox.com/topic.php?id=9644 | |
_dropbox() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts="status help puburl stop running start filestatus ls autostart exclude lansync" |
This was discovered in the comments of a "not constructive" question on Stack Overflow. Further exploration got me to this page.
$ curl -LH "Accept: text/bibliography; style=bibtex" http://dx.doi.org/10.1136/bmj.313.7072.1659
Will return (whitespace liberally added):
@article{Craddock_1996,
title={Introducing Selfcite 2.0--career enhancing software},
volume={313},
OlderNewer