Skip to content

Instantly share code, notes, and snippets.

View jsjohnst's full-sized avatar

Jeremy Johnstone jsjohnst

View GitHub Profile
@jsjohnst
jsjohnst / ec2hostname.rb
Last active August 26, 2015 19:00 — forked from kixorz/ec2hostname.rb
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
@jsjohnst
jsjohnst / ec2hostname.rb
Last active August 26, 2015 18:59 — forked from kixorz/ec2hostname.rb
EC2 DNS load-balancing init.d script. Instances automatically register themselves in Route53 RecordSets and properly update their records when starting/shutting down. Instances need to use attached IAM role allowing them to modify the Route53 zone.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS loadbalancing
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
--- Core JMX Metrics when running with Concurrent Mark and Sweep (CMS) GC
instances:
- host: "localhost"
port: 9999
init_config:
conf:
- domain: "java.lang"
bean: "java.lang:type=GarbageCollector,name=ParNew"
attribute:
CollectionTime:
function makeD3Post(post_url, avatar_url, note_count){
var D3Post = {
post: post_url,
avatar: avatar_url,
notes: note_count,
dimensions: {
'post': {
'width': 0,
'height': 0
},
<?php
Class A
{
public $foo = 3;
public function do_something() {
B::hello();
print_r($this);
}
0x000000341ec7e1f0: push %rbp
0x000000341ec7e1f1: mov %rsp,%rbp
0x000000341ec7e1f4: push %r15
0x000000341ec7e1f6: push %r14
0x000000341ec7e1f8: push %r13
0x000000341ec7e1fa: push %r12
0x000000341ec7e1fc: push %rbx
0x000000341ec7e1fd: mov %rdi,%rbx
0x000000341ec7e200: sub $0xa8,%rsp
0x000000341ec7e207: mov %edx,-0x9c(%rbp)
p.tweet-text.js-tweet-text {
font-family: 'apple color emoji', georgia, 'times new roman', serif;
}
<?php
$input = $_SERVER["argv"][1];
$output = $_SERVER["argv"][2];
$fp = fopen($output, "w");
foreach(file($input) as $line) {
$fields = explode(chr(1), trim($line));
fputcsv($fp, $fields);
<?php
declare(ticks = 1);
class TimeoutException extends Exception {};
function signal_handler($signal) {
throw new TimeoutException();
}
@jsjohnst
jsjohnst / gist:3154867
Created July 21, 2012 06:40
Tweetbot for Mac crash report
Process: Tweetbot [65834]
Path: /Applications/Tweetbot.app/Contents/MacOS/Tweetbot
Identifier: com.tapbots.TweetbotMacAdHoc
Version: 0.6.1 (656)
Code Type: X86-64 (Native)
Parent Process: launchd [281]
Date/Time: 2012-07-21 01:31:29.196 -0400
OS Version: Mac OS X 10.7.4 (11E53)
Report Version: 9