Skip to content

Instantly share code, notes, and snippets.

View craigmj's full-sized avatar

Craig Mason-Jones craigmj

View GitHub Profile
@craigmj
craigmj / find_el_causing_hscroll.html
Created November 28, 2019 16:34
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.
<!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.
<!doctype html>
<html>
<head>
<title>The Rainbow</title>
<style>
body {
background-color: #333;
font-weight: bold;
font-size: 64px;
color: white;
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 June 13, 2013 01:07
Performance testing of goroutine vs sync map implementation in Go.
package main
import (
"fmt"
"math/rand"
"runtime"
"strconv"
"sync"
"time"
)