Skip to content

Instantly share code, notes, and snippets.

View pjsvis's full-sized avatar

Peter John Smith pjsvis

  • Virtual Information Systems
  • Edinburgh
View GitHub Profile
@pjsvis
pjsvis / gist:3443800779c446d4bd791e5f9b9e3e2d
Created April 7, 2016 14:14
Create an MD5 hash and get a gravatar image
function get_gravatar(email, size) {
// MD5 (Message-Digest Algorithm) by WebToolkit
//
var MD5 = function(s) { function L(k, d) { return (k << d) | (k >>> (32 - d)); } function K(G, k) { var I, d, F, H, x; F = (G & 2147483648); H = (k & 2147483648); I = (G & 1073741824); d = (k & 1073741824); x = (G & 1073741823) + (k & 1073741823); if (I & d) { return (x ^ 2147483648 ^ F ^ H); } if (I | d) { if (x & 1073741824) { return (x ^ 3221225472 ^ F ^ H); } else { return (x ^ 1073741824 ^ F ^ H); } } else { return (x ^ F ^ H); } } function r(d, F, k) { return (d & F) | ((~d) & k); } function q(d, F, k) { return (d & k) | (F & (~k)); } function p(d, F, k) { return (d ^ F ^ k); } function n(d, F, k) { return (F ^ (d | (~k))); } function u(G, F, aa, Z, k, H, I) { G = K(G, K(K(r(F, aa, Z), k), I)); return K(L(G, H), F); } function f(G, F, aa, Z, k, H, I) { G = K(G, K(K(q(F, aa, Z), k), I)); return K(L(G, H), F); } function D(G, F, aa, Z, k, H, I) { G = K(G, K(K(p(F, aa, Z), k), I)); return K
@pjsvis
pjsvis / cloudSettings
Last active April 29, 2017 11:44
Visual Studio code settings
{"lastUpload":"2017-04-26T10:10:35.981Z","extensionVersion":"v2.6.2"}
// Visual Studio has a binding of BeforeBuild: main
// This means that when you build the app the main task will run.
//
// References
// 1. [https://gist.github.com/spboyer/96339ce687b0c79b8258](https://gist.github.com/spboyer/96339ce687b0c79b8258)
// 1. [http://stackoverflow.com/questions/32824381/parse-main-bower-files-js-css-scss-images-to-distribution-via-gulp](http://stackoverflow.com/questions/32824381/parse-main-bower-files-js-css-scss-images-to-distribution-via-gulp)
'use strict';
// The following dependencies are installed by
// ```
{
"env": {
"browser": true
},
"globals": {
"angular": false, // IE Cannot overwrite angular
"agGrid": false,
"$": false,
"_": false,
"require" : false,
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# UTP Config Specific
=======
## Project Specific Files and Folders
bin/
build/
content/
{
"doctype-first": false,
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"tag-pair": true,
"spec-char-escape": true,
"id-unique": true,
"src-not-empty": true,
"attr-no-duplication": true,
{
"doctype-first": false,
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"tag-pair": true,
"spec-char-escape": true,
"id-unique": true,
"src-not-empty": true,
"attr-no-duplication": true,
{
"rules": {
"selector-no-id": true
}
}
{
"rules": {
"selector-no-id": true
}
}
{
"name": "app",
"version": "0.0.0",
"dependencies": {
"modernizr": "^3.3.1",
"jquery": "^3.1",
"signalr": "^2.2.0",
"lodash": "4.3.0",
"angular": "^1.5.0",
"angular-route": "^1.5.0",