Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile
@janxious
janxious / jq-cheetsheet.md
Created August 25, 2022 18:04 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@janxious
janxious / family.lua
Last active September 27, 2019 00:13 — forked from Putnam3145/family.lua
A family tree generator for Dwarf Fortress.
-- export family trees
-- by Putnam https://gist.github.com/Putnam3145/34f7046481256cc4709d
--[====[
family
======
TODO
family -exportToCSV -this -heritage
family -exportToFamilyScript -this -heritage
]====]
@janxious
janxious / nmerge.rb
Created February 11, 2012 03:02 — forked from spraints/nmerge.rb
class Hash
def self.nmerge(*hashes, &block)
keys = hashes.map(&:keys).flatten.uniq
rhashes = hashes.reverse
keys.inject({ }) do |output, key|
if block
output[key] = block.call(key, hashes.map{ |x| x[key]})
else
rhashes.each do |hash|
if hash[key]
@janxious
janxious / html5.html
Created December 20, 2011 01:28 — forked from mustmodify/html5.html
Attempts to get DocRaptor to render inline SVG images
<!DOCTYPE html>
<html>
<head>
<title>MathML and SVG in text/html</title>
</head>
<body>
<a href="https://developer.mozilla.org/en/Code_snippets/Embedding_SVG">Source</a>
<h1>SVG in text/html</h1>
<p><svg height=86 width=90 viewBox='5 9 90 86' style='float: left;'>
<path stroke=#F53F0C stroke-width=10 fill=#F5C60C stroke-linejoin=round d='M 10,90 L 90,90 L 50,14 Z'/>
@janxious
janxious / rails_project_start_checklist.markdown
Created November 4, 2011 01:38 — forked from codatory/rails_project_start_checklist.markdown
(Ideal) Rails Project Pre-Start Checklist

(Ideal) Rails Project Pre-Start Checklist

Source Control

  • Code is under source control (git) with a remote I can read/write to
  • Do previous developers still have access to the remote? Should they?

Access

  • Do I have SSH access to any staging/production boxes in use?
  • Do previous developers still have access to those? Should they?
  • Do I have granted access to or owner account credentials for any dependent SaaS products or other software?
@janxious
janxious / async_ruby_example.rb
Last active September 26, 2015 05:17 — forked from spacetc62/MainWindow.xaml.cs
DocRaptor Examples Set 2 - Ruby
require 'rubygems'
require 'doc_raptor'
TEN_SECONDS = 10
FIVE_MINUTES = 300
DocRaptor.api_key "YOUR_API_KEY_HERE"
pdf_html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en"><body><a href="http://google.com">google</a></body></html>'
@janxious
janxious / DocRaptor.cs
Created June 24, 2011 21:01 — forked from spacetc62/MainWindow.xaml.cs
DocRaptor Examples Set 1 - Non-Ruby
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Web;
namespace DocRaptorConsoleExample {
class DocRaptor {
private const string PostFormat = "doc[{0}]={1}&doc[name]={2}&doc[document_type]={3}&doc[test]={4}";
private const string ApiKey = @"YOUR API KEY HERE";
# Code review
#
# This seems really verbose...seems that there should be a simpler way to conditionally set
# the value of a variable. I would like to write something like:
# body = post.get_formatted_body || ""
#
# That fails when the post is nil. This helper has to deal with a nil post object being passed in
# so I added the .nil? check. This is a contrived version of the situation I have, so don't
# nitpick the details.
#
# -*- coding: utf-8 -*-
module Color
COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33, :magenta => 35 }
end
class Test::Unit::Slow
alias :old_long_display :long_display
def long_display
time_index = /\d+\.\d+s$/ =~ old_long_display
time = old_long_display[time_index..-1] if index
@janxious
janxious / activesupport.rb
Created January 31, 2010 22:07 — forked from expectedbehavior/activesupport.rb
Test::Unit Cucumber-style Tagging
module ActiveSupport
module Testing
module Declarative
alias :tu_test_original :test
# test "verify something", [:slow, :wip] do
# ...
# end
def test(name, tags = nil, &block)