Skip to content

Instantly share code, notes, and snippets.

Annika Backstrom abackstrom

Block or report user

Report or block abackstrom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example.md

Before:

function the_thing() {
    echo "haha CODE";
}

After:

@abackstrom
abackstrom / server.py
Last active Dec 23, 2015
Sample Python server to return formatted data for GeekTool.
View server.py
#!/usr/bin/env python
#
# Run this in the background. Poll using netcat:
#
# $ nc localhost 5005
#
# Made for use with GeekTool. http://projects.tynsoe.org/en/geektool/
#
@abackstrom
abackstrom / highlight.sh
Last active Dec 21, 2015
Series of scripts to send syntax-highlighted email from the command line. Sample usage: git diff | highlight | vipe | pmail -t team@company.com -s "Code Review"
View highlight.sh
#!/bin/bash
if [ -n "$1" ] ; then
pygmentize -O full -f html "$@"
else
pygmentize -O full -f html -g
fi
@abackstrom
abackstrom / gist:6106159
Last active Dec 20, 2015
Weechat configuration to customize the hotlist. Cycle through buffers with alt-a. See Notify Levels: http://weechat.org/files/doc/devel/weechat_user.en.html#notify_levels.
View gist:6106159
/set weechat.look.buffer_notify_default highlight
/set weechat.notify.irc.freenode.#wordpress all
/set weechat.notify.irc.freenode.#pelican all
@abackstrom
abackstrom / gist:5799310
Created Jun 17, 2013
Enable GitHub "Repository Next"
View gist:5799310
$('<a href="/users/' + $("#js-command-bar-field").data('username') + '/enable_repository_next" class="button minibutton flash-action blue" data-method="post">Enable Repository Next</a>').appendTo(document.body).click()
@abackstrom
abackstrom / gist:5526832
Last active Dec 17, 2015
Lua-driven nginx config to make my website's SSL redirect work with App.net domain validation. App.net does not follow redirects during the validation process. This config ensures the validator gets a response code and body it understands.
View gist:5526832
# http->https redirect
server {
listen 207.192.74.235:80;
server_name sixohthree.com;
include logging.conf;
access_log /var/www/sixohthree.com/logs/access_log custom;
error_log /var/www/sixohthree.com/logs/error_log error;
location / {
View arbitrary-siteurl.diff
Index: domain_mapping.php
===================================================================
--- domain_mapping.php (revision 9545)
+++ domain_mapping.php (revision 9553)
@@ -515,27 +515,37 @@
}
-function domain_mapping_siteurl( $setting ) {
- global $wpdb, $current_blog;
+function domain_mapping_siteurl( $setting, $blog_id = 0 ) {
@abackstrom
abackstrom / gist:4611843
Last active Dec 11, 2015
post-commit hook for @mikesusz
View gist:4611843
#!/bin/sh
# curl https://gist.github.com/raw/4611843/gistfile1.sh > .git/hooks/post-commit && chmod +x .git/hooks/post-commit
git diff-tree -p HEAD^ | grep livereload 2>&1 >/dev/null
if [ $? -eq 0 ] ; then
echo -e "\e[0;31m!!! Don't commit livereload stuff. --amend that commit.\e[0m"
fi
View gist:4353734
/* pinboard.in style to hide private bookmarks, except on hover */
.bookmark.private {
opacity: 0;
}
.bookmark.private:hover {
opacity: 1;
}
View gist:4331659
<?php
//
// The following code exists in the public domain. No warranty is expressed or implied.
//
/**
* Return the priority of the currently-running filter.
*/
function current_filter_priority() {
You can’t perform that action at this time.