Skip to content

Instantly share code, notes, and snippets.

@nickbosch
nickbosch / keybase.md
Created June 10, 2020 01:29
keybase.md

Keybase proof

I hereby claim:

  • I am nickbosch on github.
  • I am nickbosch (https://keybase.io/nickbosch) on keybase.
  • I have a public key ASBt0vOzvb29-MtmD1Lav5Ltqyz_BjyYRVMjgbiGEEIHSgo

To claim this, I am signing this object:

#!/bin/bash
# setup home folder
mkdir -p ~/bin
# install wp-cli
cd ~
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
@nickbosch
nickbosch / year.html
Created January 17, 2018 02:41
Output the current year
<script>document.write(new Date().getFullYear())</script>
@nickbosch
nickbosch / getbib.sh
Last active November 5, 2017 23:32
Get bibliographic details in bibtex format
# for bibtex users on Linux/macOS, add this to your ~/.bashrc or ~/.bash_profile then restart your shell
# usage: getbib [doi]
# added bonus for macOS users, use: 'getbib [doi] | pbcopy' to copy the entry straight to your clipboard.
# (I'm sure there's a way to do this on linux too)
getbib() {
curl -LH "Accept: application/x-bibtex" http://dx.doi.org/$1
}
@nickbosch
nickbosch / 0_reuse_code.js
Created September 9, 2016 12:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nickbosch
nickbosch / limit_search.php
Created April 1, 2012 21:12
Limit WordPress search to currently logged in user
<?php
function limit_search_author( $query ) {
if ( $query->is_search ) {
$current_user = wp_get_current_user();
if ( !( $current_user instanceof WP_User ) )
return $query;