Skip to content

Instantly share code, notes, and snippets.

@panozzaj
panozzaj / gist:11311040
Created April 26, 2014 03:32
Jenkins + Jekyll Scheduled Post
#!/bin/bash -l
set -e
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH
export LANG="en_US.UTF-8"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
@panozzaj
panozzaj / gist:1bfb37e8689a32f1b0fb
Created May 9, 2014 00:45
grpg state brainstorm
"town:King":
states:
initial:
condition: (gameState) ->
!gameState.magicKey and numTimesTalked is 0
transitions:
talk: "followUp"
action: ->
dialog [
"""

I was going to reply on Twitter with a cryptic response and a bunch of abbreviations, figured I would expand. Maybe the gist comments would faciliate people being more expansive. To me, Twitter is good for information sharing, bad at following conversations. I always miss a post or two.

I have a blog post half written (don't we all...) about doing things that are painful more often and trying to automate them, so this struck a chord. Also, at $JOB, the simpler the process can be for getting someone onboarded and for me to get new dependencies as they are introduced to the project, the better. So this is something I have been thinking about.

I liked Matt's original post and followups. Why aren't more internal / private projects as easy to get started with as popular open source projects? I looked at the Stringer docs today actually, and you don't even need to install anything, it is a click-one-button-and-some-change operation to get it running.

It is frustrating to me

@panozzaj
panozzaj / convert.rb
Created April 13, 2015 22:28
AlphaSmart Neo file dump conversion script
#!/usr/bin/env ruby
# Takes a NEO import and converts it into more readable files and filenames
require 'fileutils'
(1..8).to_a.each do |filenum|
filename = "File #0#{filenum}.txt"
if File.exist?(filename)
FileUtils.cp filename, "#{filenum}.txt"
@panozzaj
panozzaj / gist:f0e7a2e82d29deb7037e
Created April 21, 2015 17:29
Block StackExchange distracting content
// ==UserScript==
// @name SO cleanup
// @namespace panozzaj@gmail.com
// @version 1
// @grant none
// @include http://stackoverflow.com/*
// @include https://stackoverflow.com/*
// @include http://*.stackexchange.com/*
// @include https://*.stackexchange.com/*
// @require http://code.jquery.com/jquery-2.1.3.min.js
" function for working with files with hard line breaks
cabbr eighty call Eighty()
fun! Eighty()
let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) " highlight any line > 80 characters
set textwidth=80
colo neon
endfu
Works with Ruby 1.8.7, but not Ruby 1.9. This could have been a problem because I manually installed Ruby 1.9.
I would guess this is a bug in fileutils, a Windows-related problem, or some combination thereof.
#####
# test.rb
require 'fileutils'
filenames = ARGV
zsh + couchdb:
alias uuid="curl -s http://127.0.0.1:5984/_uuids | sed s/'^.*\\['// | sed s/'].*'// | sed s/'\"'//g | sed s/','/' '/g"
Then use `uuid` to put in a uuid. This is useful for local curl'ing.
Example:
> curl -X PUT -d '{"hello": "world"}' http://127.0.0.1:5984/mydb/`uuid`
@panozzaj
panozzaj / diff_script
Created May 12, 2011 19:25
Word diff two markdown files in git and output the result formatted for Pandoc CSS
#!/bin/zsh
filename=$1
if [[ -z $filename ]] || [[ $filename == 'help' ]]
then
echo 'usage: diff_script file.markdown [old_revision] [new_revision]'
echo ' old_revision defaults to HEAD^'
echo ' new_revision defaults to current file (HEAD if unchanged)'
exit
fi
@panozzaj
panozzaj / welcome_index_view
Created June 28, 2011 19:47
@baird_rt asked me what else I could be except for 'Definitely Alive!'
- if @last_tweet_time.nil? || @last_checkin_time.nil?
.header.hmm
Had problems querying services. Try again later.
- else
- last_action = @last_tweet_time > @last_checkin_time ? @last_tweet_time : @last_checkin_time
- if last_action > 2.hours.ago
.header.alive
Anthony is definitely alive!
- elsif last_action > 6.hours.ago
.header.alive