Skip to content

Instantly share code, notes, and snippets.

View robmcalister's full-sized avatar
🐢
Slowly, but surely.

Robbie McAlister robmcalister

🐢
Slowly, but surely.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am robmcalister on github.
  • I am robmcalister (https://keybase.io/robmcalister) on keybase.
  • I have a public key ASA8JzF82oqSEkbwE09bSf317TwbRPPX5oUFTv50nTZVWAo

To claim this, I am signing this object:

@robmcalister
robmcalister / fiddle.css
Created March 16, 2018 05:25 — forked from anonymous/fiddle.css
Formatted currency input component using Vue.js (source: https://jsfiddle.net/mani04/bgzhw68m/)
body {
margin: 20px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
input {
border: 1px solid #888;
font-size: 1.2rem;
padding: 0.5rem;
}
@robmcalister
robmcalister / core.js
Created October 18, 2017 03:35 — forked from RobK/core.js
NodeJS example code to generate a RFC 2104 compliant HMAC
var crypto = require("crypto");
/**
* Get the signature/digest of a supplied input string
* @param data [Required] The String to encode
* @param awsSecretKey [Required] Secret key shared with Amazon
* @param algorithm [Optional] Encryption algorithm, defaults to sha256
* @param encoding [Optional] The output encoding. Default to base64
* @returns Str with encoded digest of the input string
*/
function generateHmac (data, awsSecretKey, algorithm, encoding) {
@robmcalister
robmcalister / gen_hmac.js
Created October 18, 2017 03:33 — forked from turret-io/gen_hmac.js
Generate HMAC in NodeJS
var crypto = require('crypto');
var SHARED_SECRET = "sup3rs3cr3t!!";
function signString(string_to_sign, shared_secret) {
var hmac = crypto.createHmac('sha512', shared_secret);
hmac.write(string_to_sign);
hmac.end()
return hmac.read();
}
@robmcalister
robmcalister / 3-vim-tips-with-external-commands.md
Created April 12, 2017 12:39 — forked from nepsilon/3-vim-tips-with-external-commands.md
3 Vim tips with external commands — First published in fullweb.io issue #95

3 Vim tips with external commands

Vim has this ! special character that will run any shell command without having to close it. Here are 3 ways I often use it:

1. Format a JSON blob:

:%!python -m json.tool

2. Count number of characters in a file:

@robmcalister
robmcalister / how-to-disable-html-links-with-css.md
Created March 21, 2017 02:22 — forked from nepsilon/how-to-disable-html-links-with-css.md
How to disable HTML links with CSS? — First published in fullweb.io issue #92
@robmcalister
robmcalister / static_server.js
Last active June 27, 2016 14:33 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8080;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@robmcalister
robmcalister / RequestAnimationFrame.js
Last active January 3, 2016 09:29 — forked from mrdoob/RequestAnimationFrame.js
Request Animation Frame
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
@robmcalister
robmcalister / hold.js
Last active January 3, 2016 04:59
Tap and Hold directive for angularjs (rmHold).
app.directive('rmHold', ['$timeout', function($timeout) {
return {
restrict: 'A',
link: function(scope, elem, attrs) {
var isActive = false;
var currentTimeout = null;
var startCoords = {
x: null,
y: null
}
@robmcalister
robmcalister / overflow_truncate_ellipsis.css
Created December 11, 2013 14:58
Overflow truncate with ellipsis
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;