Skip to content

Instantly share code, notes, and snippets.

View jasonhancock's full-sized avatar
meh

Jason Hancock jasonhancock

meh
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active May 14, 2025 01:55
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kendellfab
kendellfab / golang-json-marshall
Created August 16, 2013 22:35
Handling custom Json marshalling in golang.
type Whatever struct {
someField int
}
func (w Whatever) MarshalJSON() ([]byte, error) {
return json.Marshal(struct{
SomeField int `json:"some_field"`
}{
SomeField: w.someField,
})
@rafaelfelix
rafaelfelix / ec2tags.rb
Last active January 17, 2020 08:55 — forked from drohr/ec2tags.rb
Hack to get ec2 tags to facter. Depends on aws-cli (https://github.com/aws/aws-cli), jq (http://stedolan.github.io/jq/) and the JSON RubyGem (http://rubygems.org/gems/json)
require 'facter'
require 'json'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("aws ec2 describe-tags --filters \"name=resource-id,values=#{instance_id}\" --region #{region} | jq '[.Tags[] | {key: .Key, value: .Value}]'")
parsed_tags = JSON.parse(tags)
parsed_tags.each do |tag|
@jfryman
jfryman / gist:5808537
Created June 18, 2013 19:36
NagiosDB - Generate Nagios configs from Puppet Exported Resources + PuppetDB
#!/usr/bin/env ruby
#
# Nagios/PuppetDB config generator
#
# Based on concept from puppetdb-external-naginator
# https://github.com/favoretti/puppetdb-external-naginator
#
# Generates nagios configs from puppet(db) exported resources.
#
require 'rubygems'
@christianchristensen
christianchristensen / language_vendors.md
Last active December 16, 2015 19:39
Vendorize all the things; dependable dependency management.

Vendorize

Vendoring dependencies can provide quite a bit of freedom: from properly specified versions to clearly defined isolation. There's also some interesting interplay with OS level (or external to the language) dependencies which can be handled with proper package management; see Dependency management for grown ups. This serves as a guide for similar usage across languages.

Go

$GOPATH

Research:

@adamloving
adamloving / temporary-email-address-domains
Last active April 16, 2025 06:03
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

#!/usr/bin/env node
var Client = require('irc').Client;
// configuration
// irc. server names, guys to auto-op, etc
var botname = "opsangeles-bot";
var server = "chat.freenode.com";
var channel = [ "#opsangeles" ];
var opusers = [
@lusis
lusis / cloudstack-centos6.conf
Created March 24, 2012 05:04
fairly unsafe cloudstack upstart script to set hostname
# cloudstack - Changes hostname
#
# changes hostname to match cloudstack instance name
# centos version (tested on CentOS 6)
description "Changes hostname"
start on started network
task
@tobert
tobert / zeromq_log_forwarder.pl
Created March 21, 2012 14:51
A perl/ZeroMQ log forwarder
#!/usr/bin/perl
=head1 NAME
zeromq_log_forwarder.pl - read a log and forward over ZeroMQ
=head1 SYNOPSIS
zeromq_log_forwarder.pl --logfile /full/path/to/logfile