Skip to content

Instantly share code, notes, and snippets.

View navarr's full-sized avatar
🖥️
Magento

Navarr Barnier navarr

🖥️
Magento
View GitHub Profile
@navarr
navarr / REST.php
Created May 11, 2014 01:18
Did I program this? Because I am *not* proud of it
<?php
class Rest
{
public $host = null;
public $verb = null;
public $path = null;
public $scheme = 'http';
public $params = array();
public $post = array();
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<!--
A tic tac toe game written in XHTML5 for 314
by Navarr T. Barnier
-->
<head>
<title>Tic-Tac-Toe</title>
<style>
body { text-align: center; background-color: #111111; color: #DDDDDD; font-family: sans-serif; }
<!DOCTYPE html>
<p class="a">This is the first paragraph of text.</p>
<p class="b">This is the second paragraph of text.</p>
<p class="c">This is the third paragraph of text.</p>
<br /><hr /><br />
Milliseconds before first fade: <input id="first" type="number" value="0" /><br />
Milliseconds for Fade: <input id="fade" type="number" value="400" /><br />
Milliseconds Between Fades: <input id="between" type="number" value="500" /><br />
<label><input type="checkbox" id="wait" /> Wait for fade to finish before starting the next</label><br />
<input type="button" id="doFade" value="Test Fade" />

Keybase proof

I hereby claim:

  • I am navarr on github.
  • I am navarr (https://keybase.io/navarr) on keybase.
  • I have a public key whose fingerprint is 343E 78BF F543 6070 C9E1 99D8 30B6 6B3E 3497 F109

To claim this, I am signing this object:

@navarr
navarr / AndroidManifest.xml
Last active December 31, 2015 02:49
Meow.apk
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:bottom="5dp"
android:left="10dp"
android:right="10dp"
android:top="5dp">
<shape android:shape="rectangle" >
<corners android:radius="2dp" />
@navarr
navarr / gist:6810352
Created October 3, 2013 14:04
healthcare.gov 500
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Could not send Message.
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:110)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:323)
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
<?php
// This is a small PHP snippet to fetch the amount of viewers for a channel.
$data = @json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/8_bit_hero'), true);
$viewerCount = 0;
if ($data && !is_null($data['stream'])) {
$viewerCount = $data['stream']['viewers'];
}
@navarr
navarr / gist:6047651
Created July 21, 2013 06:06
Convert a limited set of Markdown to HTML - specifically bold, italics, and links. This is useful in basic chat environments where you do not want block content (images, paragraphs, etc).
String.prototype.markdown2html = function () {
var text = this;
// Bold
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "<strong>$2</strong>");
// Italics
text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>");
// Auto-detect links and convert them to markdown
text = text.replace(/(\]\()?((https?|ftp|dict):[^'">\s]+)/gi, function($0, $1, $2) { return $1?$0:"[" + $2 + "](" + $2 + ")"});
// Inline Links
text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, '<a href="$4">$2</a>');
@navarr
navarr / gist:6032142
Last active December 19, 2015 23:08
Ping Bot
// Audio To Play when one of the strings is mentioned
window.pingAudio = new Audio('http://www.soundjay.com/button/sounds/beep-7.mp3');
// Array of strings to notify you on, i.e. ['Navarr','Highlife','Darn'];
window.notifyMeOn = ['ju1cy','mr_darn','admin','help'];
document.sendMessage = function (msg) {
var e = $('#taigachat_message');
var t = e.val();
e.val(msg);
$('#taigachat_send').click();