Skip to content

Instantly share code, notes, and snippets.

@kristm
kristm / deps
Last active May 5, 2016 10:32
get deploy status in shell
function deps(){
curl $(cat ~/.staging-url) | awk -F '<td>|</td>' '{ if ($2 && $2 !~ /^[0-9]/) print $2 }' |
awk -F '<|>' '{if ($3) { print $3 } else { print $0 }}' |
awk '/^http/ { url=$0 } /^[a-z0-9\/_-]+$/ { branch=$0 }
/ago$/ { gsub(/about /, "");
match($0, /[0-9]+/); time=substr($0, RSTART, RLENGTH);
if($0 ~ /hour/) { mins=time * 60 }
else if ($0 ~ /day/) { mins=time * 60 * 24 }
else if ($0 ~ /month/ || $0 ~ /year/) { mins="48000" }
else if ($0 ~ /less than a minute/) { mins=0 }
@kristm
kristm / annoying.js
Created November 22, 2018 02:52
annoying site js
/* global Element */
/**
* The Annoying Site
* https://theannoyingsite.com
*
* Author:
* Feross Aboukhadijeh
* https://feross.org
*
#!/usr/bin/env ruby
require 'csv'
def usage
puts "s3_migrate.rb \nUsage: $0 <bucket_name> <input_csv>"
end
IMAGE = 0
ORG_ID = 2
#!/usr/bin/env ruby
require 'rubyXL'
require 'rubyXL/convenience_methods'
require 'csv'
def usage
puts "Contribution Summary\nUsage: #{$0} <username>"
end
@kristm
kristm / hexcat
Created August 3, 2021 06:23
show hex color on terminal (or at least how the terminal wants to show it ^_^)
#!/bin/bash
usage="hexcat\nUsage $0 <hexcolor>"
#https://gist.github.com/mhulse/b11e568260fb8c3aa2a8
function fromhex() {
hex=$1
if [[ $hex == "#"* ]]; then
hex=$(echo $1 | awk '{print substr($0,2)}')
fi