Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Mason-Jones craigmj

View GitHub Profile
@craigmj
craigmj / find_el_causing_hscroll.html
Created Nov 28, 2019
Javascript method to find an element in html that causes a page to horizontally scroll. See console output for element tree - last element is the culprit.
View find_el_causing_hscroll.html
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="outer">
<div id="inner">
<div id="third" style="width: 2500px;">
This is probably the issue.
View rainbow.html
<!doctype html>
<html>
<head>
<title>The Rainbow</title>
<style>
body {
background-color: #333;
font-weight: bold;
font-size: 64px;
color: white;
View sse.go
package webutil
import (
"net/http"
"time"
)
// ByteWriter is a one-off utility type for writing to http.ResponseWriter
type ByteWriter struct {
http.ResponseWriter
@craigmj
craigmj / gomaps.go
Created Jun 13, 2013
Performance testing of goroutine vs sync map implementation in Go.
View gomaps.go
package main
import (
"fmt"
"math/rand"
"runtime"
"strconv"
"sync"
"time"
)