Skip to content

Instantly share code, notes, and snippets.

Jon Black jonblack

Block or report user

Report or block jonblack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jonblack
jonblack / file.rb
Last active Nov 15, 2019
keybase.md
View file.rb
### Keybase proof
I hereby claim:
* I am jonblack on github.
* I am jonblack (https://keybase.io/jonblack) on keybase.
* I have a public key ASA7Np1e3MTaf6MrhICPXGWH3Qq3Jz8Ugq12SHiqeUHTDwo
To claim this, I am signing this object:
View components.dialog-step-one.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@jonblack
jonblack / components.dialog-step-one.js
Last active Nov 14, 2017
Elsewhere Liquid Dialog Steps
View components.dialog-step-one.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@jonblack
jonblack / core_dump_test.sh
Created Mar 9, 2017
Test core dump creation
View core_dump_test.sh
#!/bin/bash
/usr/bin/g++ -x c++ - -o crash -g <<SOURCE
int main(int argc, const char **argv)
{
int *p = 0;
int r = *p + 1;
return 0;
}
@jonblack
jonblack / main.rs
Created Jan 21, 2016
Parse XML using xml-rs
View main.rs
extern crate xml;
use std::fs::File;
use std::io::BufReader;
use xml::reader::{EventReader, XmlEvent};
struct Book {
title: String,
author: String,
@jonblack
jonblack / md_inline_to_ref.py
Created May 22, 2014
Convert inline links to reference links in markdown
View md_inline_to_ref.py
import os
import re
import sys
RE_MD_INLINE_LINK = re.compile(' \[(?P<name>[\w -_]*)\]\((?P<link>[\w \-/\.:]*)\)')
if __name__ == "__main__":
src_path = sys.argv[1]
@jonblack
jonblack / useful_commands.sh
Created May 15, 2014
Useful shell commands for manipulating source code
View useful_commands.sh
# Remove trailing whitespace from all files with a given extension
find . -name "*.h" | xargs sed -i 's/[ \t]*$//'
# Convert tabs to spaces in all files with a given extension
find . -name "*.h" | xargs sed -i 's/\t/ /g'
@jonblack
jonblack / logging_info.py
Last active Aug 29, 2015
Outputs the names and levels of all configured loggers
View logging_info.py
import logging
_log = logging.getLogger(__name__)
for logger_name in logging.Logger.manager.loggerDict.keys():
print logger_name, logging.getLevelName(logging.getLogger(logger_name).level)
You can’t perform that action at this time.