Skip to content

Instantly share code, notes, and snippets.

View 0b10011's full-sized avatar

Brandon Frohs 0b10011

View GitHub Profile
@0b10011
0b10011 / cargo
Created November 22, 2019 19:23
A dockerized drop-in replacement for `cargo` that supports caching.
#!/bin/bash
# This is a drop-in replacement for `cargo`
# that runs in a Docker container as the current user
# on the latest Rust image
# and saves all generated files to `./cargo/` and `./target/`.
#
# Be sure to make this file executable: `chmod +x ./cargo`
#
# # Examples
@0b10011
0b10011 / Converter.php
Created July 10, 2015 05:06
YouTube Video Renderer for CommonMark
<?php
namespace CommonMark;
use CommonMark\Inline\Processor\YouTubeVideoProcessor;
use CommonMark\Inline\Renderer\YouTubeVideoRenderer;
use League\CommonMark\Converter;
use League\CommonMark\Environment;
use League\CommonMark\DocParser;
/*jslint nomen: true */
/*global $, ga, findAll, FB, HTMLFormElement */
/*jslint nomen: false */
(function () {
"use strict";
if (!$.support.pjax) {
// If PJAX isn't supported, there is no need to run this code
return;
}
@0b10011
0b10011 / jquery.pjax.js
Created October 14, 2014 16:09
PJAX with file uploads, etc
/*!
* jquery.pjax.js
* copyright chris wanstrath
* https://github.com/defunkt/jquery-pjax
*
* Support for uploading files added by Brandon Frohs <bfrohs@gmail.com>
*/
(function($){

Foo bar hello

Foo ~~bar ~~ hello

Foo ~~bar ~~hello

Foo ~~bar hello~~~ world

Foo ~~~bar hello~~ world

/**
* Implements http://meta.stackoverflow.com/a/270612/526741
*
* 1. Go to Help > Troubleshooting Information in Firefox
* 2. Click "Open Directory" next to "Profile Directory"
* 3. Open (or create) "chrome" directory
* 4. Edit (or create) "userContent.css" in the "chrome" directory
* 5. Set contents of file to this file
*/
@-moz-document domain(stackoverflow.com) {
@0b10011
0b10011 / userContent.css
Last active December 26, 2015 13:49
Altered userContent.css for Firefox to style StackOverflow blockquotes to look different than code blocks.
/*
* Sets blockquotes on stackoverflow.com to have a yellowish background
* with a box shadow, instead of the same background as code blocks.
* Helps to show code inside of blockquotes.
*
* Sets links to be underlined by default so multi-word links and
* single-word links can be distinguished.
*
* Should be added to ./chrome/userContent.css in your Firefox profile
* directory. Profile directory can be found by clicking "Help", then
IF( SUBSTRING_INDEX(`ip`,'.',1)*16777216
+ SUBSTRING(SUBSTRING_INDEX(`ip`,'.',2),1+LOCATE('.',`ip`))*65536
+ SUBSTRING(SUBSTRING_INDEX(`ip`,'.',-2),1,-1+LOCATE('.',SUBSTRING_INDEX(`ip`,'.',-2)))*256
+ SUBSTRING_INDEX(`ip`,'.',-1)
> 2147483647,
SUBSTRING_INDEX(`ip`,'.',1)*16777216
+ SUBSTRING(SUBSTRING_INDEX(`ip`,'.',2),1+LOCATE('.',`ip`))*65536
+ SUBSTRING(SUBSTRING_INDEX(`ip`,'.',-2),1,-1+LOCATE('.',SUBSTRING_INDEX(`ip`,'.',-2)))*256
+ SUBSTRING_INDEX(`ip`,'.',-1)
- 4294967296,
@0b10011
0b10011 / gist:3228241
Created August 1, 2012 16:05
Rename branch locally and for origin
# Rename branch locally
git branch -m oldName newName
# Push renamed branch to origin
git push origin newName
# Remove original branch from origin
git push origin :oldName
@0b10011
0b10011 / gist:2149039
Created March 21, 2012 16:05
Minimum test case for CodeMirror2 issue #455 (https://github.com/marijnh/CodeMirror2/issues/455)
<!doctype html>
<html>
<head>
<title>CodeMirror: Autocomplete Demo</title>
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/mode/javascript/javascript.js"></script>
<style type="text/css">.CodeMirror {width:200px;}</style>
</head>
<body>