Am I crazy? Perhaps. But why shouldn't we use gist as a blogging platform?
- support for comments
- renders markdown
- support for multiple files, so code examples can be attached as well as inline
- automatic indexing by search engines
#!/bin/bash | |
set -u | |
# usage example to find all Java source files: ./sloc-by-extension java | |
EXTENSION="${1}" | |
for dir in $(ls -d */); do | |
pushd ${dir} >/dev/null | |
LIST=$(find . -name "*.${EXTENSION}" | grep -iv test) |
Am I crazy? Perhaps. But why shouldn't we use gist as a blogging platform?
#!/bin/bash | |
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
sudo apt-get install nodejs | |
sudo chown -R $USER /usr/lib/node_modules/ | |
sudo chgrp $USER /usr/bin | |
sudo chmod g+w /usr/bin |
#!/bin/bash | |
# | |
# git-update | |
# Pull down latest from git remote and remove dead branches | |
# | |
# To create an alias to `git update`, put this on your path, then: | |
# git config --global alias.update '!git-update' | |
# | |
# Copyright (c) 2016 Leftclick.com.au | |
# License: MIT |
(function () { | |
'use strict'; | |
// Relevant resource: https://gist.github.com/spencermefford/bc73812f216e0e254ad1 | |
module.exports = function (server, callback) { | |
var ACL = server.models.ACL, | |
User = server.models.User, | |
Role = server.models.Role, | |
RoleMapping = server.models.RoleMapping; |
#!/bin/bash | |
# http://nigel.mcnie.name/blog/removing-the-referer-part-of-php-error-messagse-from-apache-logs | |
perl -pe 's/\s+\[\:error\]\s+\[pid\s+\d+\]\s+\[client\s+.*?\]//; s/, referer:.*//' |
#!/usr/bin/env php | |
<?php | |
$screen = 35; // modify as required | |
$locale = 'en_AU'; | |
$pdo = new PDO('mysql:host=wamcmisdb01-staging;dbname=cmis', 'cmis', 'uhkdv5Uwhkk7pmv'); | |
$placements = $pdo->query('select * from ca_editor_ui_bundle_placements where screen_id = ' . $screen . ' order by rank asc')->fetchAll(); | |
foreach ($placements as $placement) { | |
$settings = unserialize(base64_decode($placement['settings'])); |
maxdepth=`find . -printf '%d\\n' | sort -n | tail -1` && for depth in `seq 1 $maxdepth`; do find -mindepth 1 -maxdepth $depth -exec bash -c 'f=`echo "{}" | sed -r s:\\\s+:_:g` ; if [ "$f" != "{}" ]; then mv "{}" "$f"; fi' \; ; done |
This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.
svn.domain.com.au
.http
(other protocols should work).git.domain.com.au
and:#!/usr/bin/php | |
<?php | |
# Parse options | |
$opts = getopt('h:n:u:p:b:s:', array( 'help' )); | |
if (isset($opts['help']) && $opts['help']) { | |
echo <<<ENDHELP | |
Usage: | |
$argv[0] [-h HOSTNAME] [-n PORTNUM] [-u USERNAME] [-p PASSWORD] [-b BASEDN] [-s SEARCH] |