Skip to content

Instantly share code, notes, and snippets.

View rivy's full-sized avatar
🏠
Working from home

Roy Ivy III rivy

🏠
Working from home
View GitHub Profile
@rivy
rivy / Gitwebmarkdown.user.js
Last active April 25, 2017 01:36 — forked from nemoo/Gitwebmarkdown
Tampermonkey script for chrome to display README.md files rendered as html from markdown in gitweb
// ==UserScript==
// @name Gitwebmarkdown
// @version 0.1
// @description renders readme files in markdown
// @include http://yourserverhere.com/git/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// @require http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js
// ==/UserScript==
var converter = new Showdown.converter();
@rivy
rivy / pandoc.css
Created April 25, 2017 06:12 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@rivy
rivy / gist:3739538f0928233abb13cc0dedbb1539
Created May 3, 2017 06:42 — forked from marijnh/gist:9683027
CodeMirror merge view resize to fit content
function mergeViewHeight(mergeView) {
function editorHeight(editor) {
if (!editor) return 0;
return editor.getScrollInfo().height;
}
return Math.max(editorHeight(mergeView.leftOriginal()),
editorHeight(mergeView.editor()),
editorHeight(mergeView.rightOriginal()));
}
@rivy
rivy / parallel.js
Created May 7, 2017 19:15 — forked from ngryman/parallel.js
jQuery parallel script loading keeping execution order.
/**
* Load scripts in parallel keeping execution order.
* @param {array} An array of script urls. They will parsed in the order of the array.
* @returns {$.Deferred}
*/
function getScripts(scripts) {
var xhrs = scripts.map(function(url) {
return $.ajax({
url: url,
dataType: 'text',
@rivy
rivy / promises.md
Created May 11, 2017 04:42 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
### Keybase proof
I hereby claim:
* I am rivy on github.
* I am rivy (https://keybase.io/rivy) on keybase.
* I have a public key ASCkJkGQKV9tvKXZMJL_WZ0oqaTLEhWd4EWqkkwbJyeI4Qo
To claim this, I am signing this object:
@rivy
rivy / .gitconfig
Created August 23, 2017 03:24 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@rivy
rivy / persistent_c_mount_wsl.sh
Created December 23, 2017 23:35 — forked from sgtoj/persistent_c_mount_wsl.sh
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc