Skip to content

Instantly share code, notes, and snippets.

Adam Wagner AdamWagner

Block or report user

Report or block AdamWagner

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
@AdamWagner
AdamWagner / LevDis.gs
Created Nov 19, 2018
Levenshtein Distance Function for Google Sheets
View LevDis.gs
//
// Levenshtein Distance Function for Google Sheets
//
// This function calculates de Levenshtein Distance (or Edit Distance) between two strings.
// I used the algorith and code from Wikipedia (https://en.wikipedia.org/wiki/Levenshtein_distance)
// as a reference and just adjusted the code to be used on Google Sheets.
//
// By: Manoel Lemos / manoel@lemos.net / http://manoellemos.com
//
// IMPORTANT: I added some code in the begining of the function to try to solve the issues
@AdamWagner
AdamWagner / bash-cheatsheet.sh
Created Sep 9, 2018 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
View gist:4a2097b46ff039eb03a693ef0d0926aa
function! Strip(string)
return substitute(a:string, '^\s*\(.\{-}\)\s*\n\?$', '\1', '')
endfunction
function! TargetedTmuxCommand(command, target_pane)
return a:command . " -t " . a:target_pane
endfunction
function! SendTmuxCommand(command)
@AdamWagner
AdamWagner / workflow-build.py
Created Aug 19, 2018 — forked from duanemay/workflow-build.py
Build Alfred Workflows into .alfredworkflow (zip) files
View workflow-build.py
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 deanishe@deanishe.net.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@AdamWagner
AdamWagner / download-svgs.js
Created Aug 3, 2018
Download SVGs from web pages
View download-svgs.js
var e = document.createElement('script');
e.setAttribute('src', 'https://nytimes.github.io/svg-crowbar/svg-crowbar.js');
e.setAttribute('class', 'svg-crowbar');
document.body.appendChild(e);
@AdamWagner
AdamWagner / script.js
Created Jul 29, 2018
Userscript: Google Docs Shortcuts / Vim mode
View script.js
// ==UserScript==
// @name Google Docs Shortcuts
// @include http*://docs.google.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
var editor = document.getElementsByClassName("docs-texteventtarget-iframe")[0].contentWindow.document.querySelector("[contenteditable=\"true\"]");
View surfingkeys.js
/*
Default key bindings reference:
https://github.com/brookhong/Surfingkeys/blob/master/pages/default.js
#Inpsiring configurations
@mindgitrwx
https://github.com/mindgitrwx/gitconventions/blob/master/SurfingKeys-config-ko.js
@AdamWagner
AdamWagner / WP Get post word count
Created Nov 30, 2012
Get the word count of a WordPress blog post
View WP Get post word count
/*
Word count
*/
function wcount(){
ob_start();
the_content();
$content = ob_get_clean();
return sizeof(explode(" ", $content));
}
You can’t perform that action at this time.