start new:
tmux
start new with session name:
tmux new -s myname
update_current_git_vars |
#!/bin/bash | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by [email protected] | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# modified by [email protected] - fixes diffs that introduce new files | |
# modified by [email protected] - fix sed syntax issue in OS X | |
# | |
# Generate an SVN-compatible diff against the tip of the tracking branch |
#!/bin/sh | |
# to use, save this file as .git/hooks/pre-commit in your git repo | |
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit | |
command -v pngcrush >/dev/null 2>&1 || { | |
echo "\033[1mPlease install pngcrush to reduce images size before commit\033[0m" | |
echo "Install pngcrush with the following:" | |
echo "\t \033[1mbrew install pngcrush\033[0m" | |
echo "OR" | |
echo "\t Site: \033[1m\033[4mhttp://pmt.sourceforge.net/pngcrush/\033[0m" | |
echo "\t Download: \033[1m\033[4mhttp://sourceforge.net/projects/pmt/files/\033[0m" |
<?php | |
/** | |
* Creates nicer default avatars | |
* by using first initial on flat color | |
* | |
* How to: echo create_avatar( 'yurivictor', 48 ); | |
* Example: http://yurivictor.com/avatars | |
* | |
* @var string $user, the name of the user to create the avatar | |
* @var int $size, the size in px of the avatar |
func main() { | |
watchers, pager, _, err := client.Activity.ListWatchers("o", "r") | |
if pager.HasNext() { | |
watchers, pager, _, err = pager.Next() | |
} | |
//.. | |
//or: | |
watchers, pager, _, err = pager.Last() | |
} |
# Title: Simple Image tag for Jekyll | |
# Authors: Brandon Mathis http://brandonmathis.com | |
# Felix Schäfer, Frederic Hemberger | |
# Description: Easily output images with optional class names, width, height, title and alt attributes | |
# | |
# Syntax {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %} | |
# | |
# Examples: | |
# {% img /images/ninja.png Ninja Attack! %} | |
# {% img left half http://site.com/images/ninja.png Ninja Attack! %} |
Let's set up Camlistore on a Linux server, with blobs stored in s3. This seems to be the currently best-supported option for "cloud" deployment.
This is meant as a supplement to the official server config doc. Read through both docs before you start.
http://camlistore.org/docs/server-config
This blog post is also recommended reading.
I've posted my config files for reference, but they will be created the first time you run camlistored
(for the server) and camput init
(for the client) so don't copy them.
I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.
I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
fshow() { | |
local out shas sha q k | |
while out=$( | |
git log --graph --color=always \ | |
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
--print-query --expect=ctrl-d --toggle-sort=\`); do | |
q=$(head -1 <<< "$out") | |
k=$(head -2 <<< "$out" | tail -1) |