Skip to content

Instantly share code, notes, and snippets.

View MrHallows's full-sized avatar
🎯
Still waiting for my fellow Americans to wake the fuck up before it's too late.

MrHallows MrHallows

🎯
Still waiting for my fellow Americans to wake the fuck up before it's too late.
View GitHub Profile
@aisuii
aisuii / gist:913363
Created April 11, 2011 11:04
utils
var APP = {};
APP.data = (function(){
var data = {};
var exports = {};
var getData = function(key) {
return data[key];
};
exports.getData = getData;
@smt
smt / html.snippets
Created July 29, 2011 01:29
HTML snippets for vim-snipmate
# Some useful Unicode entities
# Non-Breaking Space
snippet nbs
 
#
snippet left
←
#
snippet right
→
@wizardishungry
wizardishungry / stellar-database-tiny.json
Created October 17, 2012 05:20
Example Stellar Database JSON
{
"Sol": {
"name": "Sol",
"proper_names": ["Sol", "Helios", "The Sun"],
"age": "4800 million years",
"standard_error_in_age": "0%",
"heavy_element_abundance": "100% of Sol",
"standard_error_in_heavy_element_abundance": "0%",
"arity": "singular",
"points_of_interest": "The \"8\" in the Detected Planets entry is not an error. Pluto is not a \"planet,\" but a huge, close-orbiting, low-eccentricity Kuiper Belt object. With a big moon. Of course, some die-hards out there still insist that it really is a planet, more for sentimental reasons than anything else. They're welcome to live in their little fantasy world. Neener neener.",
@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>';
@frankyonnetti
frankyonnetti / CSS--hex-opacity-values.css
Last active December 8, 2023 05:56
#css Hex Opacity Values
/*
* Hex Opacity Values
*/
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
@jclem
jclem / parse.js
Created March 19, 2014 21:01
json
var fs = require('fs');
fs.readFile('data.json', function(err, json) {
if (err) throw err;
var data = JSON.parse(json);
// do stuff with data
data.foo = 'bar';
var newJson = JSON.stringify(data);
fs.writeFile('newData.json', newJson, function(err) {
@nogweii
nogweii / ddg_bangs.rb
Created May 23, 2014 23:17
get a list of all of duckduckgo's bangs in a programmatic manner, useful for scripting
require 'nokogiri'
require 'open-uri'
require 'json'
require 'yaml'
f = open('https://duckduckgo.com/bang.html', {"User-Agent" => 'Ruby script parsing the full list of bangs/1.0 ; http://evaryont.me'}).read
n = Nokogiri.parse(f)
class DDGBang < Struct.new(:category, :group, :bang, :aliases, :full_name)
def to_json(*)
@MrRuiz
MrRuiz / index.html
Last active December 18, 2020 11:05
HTML: Basic HTML Template
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
@iTonyYo
iTonyYo / text.excerpt.js
Created March 19, 2015 02:35
Trim a block of text to a specified amount of characters.
/**
* Trim a block of text to a specified amount of characters.
*
* @param string elem string to 'cut'.
* @param integer length Character count/length. Default 30.
* @param string more Text to display as 'more'. Default '...'
*
* @return string
*/
$.textExcerpt = function (elem, length, more) {
@jasonbrice
jasonbrice / html_debug_console.js
Last active August 13, 2021 01:37
Show console output as HTML for browsers with no console (e.g., safari on iPad)
// set an identifier for the console div
var consoleId = 'debug_console';
// initialize the debug console, dock to bottom of page
var debugConsole = function () {
var body = document.getElementsByTagName('body')[0];
// since this function also gets called on clear(),
// we'll remove the div if it exists so we can re-add it