Skip to content

Instantly share code, notes, and snippets.

View mailtruck's full-sized avatar
👨‍✈️

Brian Danowski mailtruck

👨‍✈️
  • Ferndale, MI
View GitHub Profile
@mailtruck
mailtruck / ClickToSplit.js
Created October 4, 2012 23:22 — forked from clauswitt/ClickToSplit.js
Click to Split
function onclick(e) {
var range;
if (document.caretRangeFromPoint) {
range = document.caretRangeFromPoint(e.pageX, e.pageY);
} else if (e.rangeParent) {
range = document.createRange();
range.setStart(e.rangeParent, e.rangeOffset);
}
var textContainer = range.startContainer;
@mailtruck
mailtruck / app.js
Created October 9, 2012 00:45 — forked from prognostikos/app.js
AngularJS & Rails
/**
* Angular needs to send the Rails CSRF token with each post request.
*
* Here we get the token from the meta tags (make sure <%= csrf_meta_tags %>
* is present in your layout.)
*/
angular.module('myapp',[]).
// configure our http requests to include the Rails CSRF token
config(["$httpProvider", function(p) {
var m = document.getElementsByTagName('meta');
@mailtruck
mailtruck / index.html
Created June 3, 2016 02:52
tic tac toe!
test
@mailtruck
mailtruck / tmux-cheatsheet.markdown
Created September 2, 2016 03:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
// https://github.com/webmodules/jsonp
function noop(){}function jsonp(e,o,n){function t(){r.parentNode&&r.parentNode.removeChild(r),window[a]=noop,i&&clearTimeout(i)}function c(){window[a]&&t()}"function"==typeof o&&(n=o,o={}),o||(o={});var r,i,u=o.prefix||"__jp",a=o.name||u+count++,p=o.param||"callback",l=null!=o.timeout?o.timeout:6e4,m=encodeURIComponent,d=document.getElementsByTagName("script")[0]||document.head;return l&&(i=setTimeout(function(){t(),n&&n(Error("Timeout"))},l)),window[a]=function(e){console.log("jsonp got",e),t(),n&&n(null,e)},e+=(~e.indexOf("?")?"&":"?")+p+"="+m(a),e=e.replace("?&","?"),console.log('jsonp req "%s"',e),r=document.createElement("script"),r.src=e,d.parentNode.insertBefore(r,d),c}var count=0;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from
Array.from||(Array.from=function(){var n=Object.prototype.toString,e=function(e){return"function"==typeof e||"[object Function]"===n.call(e)},t=function(n){var e=+n;return isNaN(e)?0:0!==e&&isFinite(e)?(e>0?1:-1)*Math.floor(Math.abs(e)):e},o=Math.pow(2,53)-1,r=function(n){var e=t(n);return Math.min(Math.max(e,0),o)};return function(n){var t=this,o=Object(n);if(null==n)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i,a=arguments.length>1?arguments[1]:void 0;if(void 0!==a){if(!e(a))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(i=arguments[2])}for(var u,c=r(o.length),l=e(t)?Object(new t(c)):Array(c),f=0;c>f;)u=o[f],l[f]=a?void 0===i?a(u,f):a.call(i,u,f):u,f+=1;return l.length=c,l}}());
(function(){
callback314([{"artist":"Zoltan & Gabor","cardClass":"SHAMAN","collectible":true,"cost":2,"dbfId":404,"flavor":"It was just a flesh wound.","id":"CS2_038","name":"Ancestral Spirit","playRequirements":{"REQ_MINION_TARGET":0,"REQ_TARGET_TO_PLAY":0},"playerClass":"SHAMAN","rarity":"RARE","referencedTags":["DEATHRATTLE"],"set":"EXPERT1","text":"Give a minion \"<b>Deathrattle:</b> Resummon this minion.\"","type":"SPELL"},{"artist":"John Polidora","attack":10,"cardClass":"NEUTRAL","collectible":true,"cost":9,"dbfId":2725,"elite":true,"flavor":"This massive yeti just closes his eyes and charges at the nearest target. The nearest Target is a couple blocks away and has sick deals on skateboards.","health":10,"id":"AT_125","mechanics":["CHARGE"],"name":"Icehowl","playerClass":"NEUTRAL","rarity":"LEGENDARY","set":"TGT","text":"<b>Charge</b>\nCan't attack heroes.","type":"MINION"},{"artist":"Lucas Graciano","cardClass":"PALADIN","collectible":true,"cost":3,"dbfId":679,"flavor":"This is not just a favor, bu
https://tools.ietf.org/rfc/rfc959.txt
This memo is the official specification of the File Transfer
Protocol (FTP). Distribution of this memo is unlimited.
The following new optional commands are included in this edition of
the specification:
CDUP (Change to Parent Directory), SMNT (Structure Mount), STOU
(Store Unique), RMD (Remove Directory), MKD (Make Directory), PWD
swagger: "2.0"
info:
version: "1.0"
title: Benzinga Delayed Quote API
description: Benzinga Delayed Quote REST API
host: api.benzinga.com
basePath: /api/v1
schemes:
- http
- https
@mailtruck
mailtruck / index.html
Created June 30, 2017 02:12 — forked from anonymous/index.html
MDL getting started
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
</head>
<body>
<div class="mdl-layout">
<main class="mdl-layout__content">