Skip to content

Instantly share code, notes, and snippets.

View jameswestgate's full-sized avatar
🎯
Focusing

James Westgate jameswestgate

🎯
Focusing
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Diagnostics.Eventing.Reader;
using HarmonyLib;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id='div' contenteditable='true' onpaste='return handlepaste(this, event)'>Existing text</div>
@jameswestgate
jameswestgate / lightbox.css
Created April 11, 2012 09:11
CSS Only Lightbox
#lightbox-overlay{
display: none;
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background-color: black;
background-color: rgba(0,0,0,0.8);
z-index:9998;
@jameswestgate
jameswestgate / constants.js
Created February 24, 2012 08:54
JavaScript quick and dirty constants
(function() {
var constants = {}; //or window?
window.const = function() { //or possibly window._ with arg[0] being string = syntax or object literal as well
if (!args.length) return constants;
var value = constants[args[0]];
if (args.length === 1) return value;
@jameswestgate
jameswestgate / reponsive-images.html
Created February 23, 2012 16:04
Responsive images approach
<!-- <a> tag replaces image tag and the class determines the intended media which is modified in the css -->
<!-- start with mobile first 320px and progressively enhance -->
<div class="responsive">
<a class="r320" href="cat320.jpg" title="A kitten"></a>
<a class="r480" href="cat480.jpg" title="A cat"></a>
<a class="r720" href="cat720.jpg" title="A lion aargh!"></a>
</div>