Skip to content

Instantly share code, notes, and snippets.

View liamengland1's full-sized avatar
💭
I may be slow to respond.

Liam England liamengland1

💭
I may be slow to respond.
View GitHub Profile
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
@RustingSword
RustingSword / hosts.md
Created November 26, 2012 13:20
Hosts for Google Services

via http://shen0956.com/?p=1523

173.194.72.82 www.google.com.hk

74.125.31.189 mail.google.com
74.125.31.189 plus.google.com
74.125.31.189 adsense.google.com
74.125.31.189 analytics.google.com
74.125.31.189 drive.google.com

74.125.31.189 translate.google.cn

@bencevans
bencevans / gist:5162086
Created March 14, 2013 15:06
spotify-web skeleton

var Spotify = require('spotify-web');

{ [Function: Spotify]
  gid2id: [Function],
  id2uri: [Function],
  uri2id: [Function],
  gid2uri: [Function],
  uriType: [Function],
  login: [Function],

super_: [Function: EventEmitter] }

@gregseth
gregseth / email-regex.md
Last active March 18, 2025 09:57
RegEx for RFC 2822 compliant email address.

Complete version

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\ x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])

Simpler version

[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?

Sources

@vaiorabbit
vaiorabbit / fnv32a.js
Last active February 4, 2024 19:49
FNV-1a Hash (http://isthe.com/chongo/tech/comp/fnv/) in JavaScript.
// 32 bit FNV-1a hash
// Ref.: http://isthe.com/chongo/tech/comp/fnv/
function fnv32a( str )
{
var FNV1_32A_INIT = 0x811c9dc5;
var hval = FNV1_32A_INIT;
for ( var i = 0; i < str.length; ++i )
{
hval ^= str.charCodeAt(i);
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
@cuibonobo
cuibonobo / twitter-trends.md
Created June 2, 2013 19:40
Twitter Trends
@willurd
willurd / web-servers.md
Last active June 14, 2025 07:39
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@Daniel15
Daniel15 / 1_README.md
Last active March 22, 2025 04:24
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

"use strict";(function(e,n,t){function r(e){return String.fromCharCode(e)}function i(e){return e&&"number"==typeof e.length?"function"!=typeof e.hasOwnProperty&&"function"!=typeof e.constructor?!0:e instanceof an||Yt&&e instanceof Yt||"[object Object]"!==er.call(e)||"function"==typeof e.callee:!1}function o(e,n,t){var r;if(e)if(k(e))for(r in e)"prototype"!=r&&"length"!=r&&"name"!=r&&e.hasOwnProperty(r)&&n.call(t,e[r],r);else if(e.forEach&&e.forEach!==o)e.forEach(n,t);else if(i(e))for(r=0;e.length>r;r++)n.call(t,e[r],r);else for(r in e)e.hasOwnProperty(r)&&n.call(t,e[r],r);return e}function a(e){var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(t);return n.sort()}function s(e,n,t){for(var r=a(e),i=0;r.length>i;i++)n.call(t,e[r[i]],r[i]);return r}function c(e){return function(n,t){e(t,n)}}function u(){for(var e,n=tr.length;n;){if(n--,e=tr[n].charCodeAt(0),57==e)return tr[n]="A",tr.join("");if(90!=e)return tr[n]=String.fromCharCode(e+1),tr.join("");tr[n]="0"}return tr.unshift("0"),tr.join("")}function l(e){ret