Skip to content

Instantly share code, notes, and snippets.

View Chandler's full-sized avatar

Chandler Abraham Chandler

View GitHub Profile
@ssaunier
ssaunier / importpdb.sublime-snippet
Created July 5, 2018 15:11
Python debugger snippet for Sublime Text
<snippet>
<content><![CDATA[import pdb; pdb.set_trace()]]></content>
<tabTrigger>pdb</tabTrigger>
<scope>source.python</scope>
<description>import pdb</description>
</snippet>
<!-- USAGE -->
<!-- 1. Go to Tools -> New Snippet -->
@jsanders
jsanders / failures.log
Last active January 25, 2016 08:00
Servo WebSocket test failures
▶ TIMEOUT [expected OK] /websockets/Create-Secure-extensions-empty.htm
▶ Unexpected subtest result in /websockets/Create-Secure-extensions-empty.htm:
└ NOTRUN [expected PASS] W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be closed
▶ Unexpected subtest result in /websockets/Create-Secure-extensions-empty.htm:
│ FAIL [expected PASS] W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be opened
│ → assert_equals: extensions should be empty expected (string) "" but got (undefined) undefined
│ @http://web-platform.test:8000/websockets/Create-Secure-extensions-empty.htm:9:13
@danawoodman
danawoodman / 0-react-hello-world.md
Last active March 9, 2024 00:32
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

everything i write on medium is a lie
xoxo j$
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
# import threading
class WebSocketsHandler(SocketServer.StreamRequestHandler):
@jakeboxer
jakeboxer / gist:6274618
Last active December 21, 2015 07:58
From the bankofamerica.com front page
<script type="text/javascript">
if (self == top) {
var theBody = document.getElementsByTagName('body')[0];
theBody.style.display = "block";
}
else {top.location = self.location;}
</script>
@evadne
evadne / gist:5794585
Last active April 18, 2023 18:01
WWDC 2013 Videos / Slides (PDF) Downloader — run in a JavaScript console / interpreter hooked to the videos page
// Download all assets from https://developer.apple.com/wwdc/videos
// Warning: might take up a lot of disk space
NodeList.prototype.toArray = function () {
return Array.prototype.slice.call(this);
};
[].concat.apply([], document.querySelectorAll("li.session").toArray().map(function(session){
var sessionID = session.id.match(/^\d+/)[0];
var title = session.querySelector(".title").innerText;
@jkp
jkp / websocketserver.py
Created July 18, 2012 13:28
A simple WebSockets server with no dependencies
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
@mike-burns
mike-burns / gist:987910
Created May 24, 2011 00:05
Implicts in Ruby, via Scala
# Implicits in Ruby, based on Scala. Works like:
#
# implicitly.from(BaseClass).to(WrapperClass).via do |base_object|
# WrapperClass.new(base_object)
# end
#
def implicitly
Implicit.new
end