Skip to content

Instantly share code, notes, and snippets.

View moredip's full-sized avatar

Pete Hodgson moredip

View GitHub Profile
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active May 14, 2024 03:50
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@akiellor
akiellor / gist:12db63d9b578447b9aed
Created February 6, 2015 03:46
Mocha/Promise error detection.
var falafel = require('falafel');
var fs = require('fs');
var file = process.argv[2];
var src = fs.readFileSync(file).toString();
var output = falafel(src, {loc: true}, function (node) {
if (node.type === 'Identifier' && node.name === "it") {
var testBody = node.parent.arguments[1].body.body
var lastStatement = testBody[testBody.length - 1];
@ajmath
ajmath / ConsoleJsonAppenderFactory.java
Last active August 19, 2022 19:11
Dropwizard Custom Appender
package io.github.ajmath;
import io.dropwizard.logging.AbstractAppenderFactory;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.contrib.jackson.JacksonJsonFormatter;
import ch.qos.logback.contrib.json.classic.JsonLayout;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ConsoleAppender;
import ch.qos.logback.core.Layout;