Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / bling.js
Last active November 4, 2024 17:48
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

export class Counter extends React.Component {
static get propTypes() {
return {
initialCount: React.PropTypes.number
};
}
static get defaultProps() {
return {
initialCount: 1
@bendc
bendc / random-color.js
Last active February 7, 2024 03:19
Generate nice random colors
const randomColor = (() => {
"use strict";
const randomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
return () => {
var h = randomInt(0, 360);
var s = randomInt(42, 98);
anonymous
anonymous / emotibars.md
Created July 30, 2014 00:49

Emotibars

Here's a grammar off the top of my head. Feel free to challenge this if you think something's wrong. I won't be checking for insane edge-cases that are hidden in here. For instance I don't think this explains how backticks work, but that sounds like a lot of work.

emotibars
  = (string lodid)* string
 = (string openblock emotistatement closeblock)* string
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@stephen
stephen / handles
Last active August 29, 2015 14:01
Twitter handles available from /usr/share/dict/words
testing 254164 handles
zythem
zymotoxic
zymotize
zymotically
zymotechnic
zymotechny
zymotechnical
zymosterol
zymosimeter

Keybase proof

I hereby claim:

  • I am stephen on github.
  • I am swan (https://keybase.io/swan) on keybase.
  • I have a public key whose fingerprint is 5252 D938 83A1 854B 90EF C3A0 6D14 0B75 E045 33C6

To claim this, I am signing this object:

@stephen
stephen / gist:8488120
Last active January 3, 2016 16:18
Log of AirPlay send/received via AirSonos using Spotify (47 seconds of playback) from iPad Air (iOS 7) using AirSonos commit 6f8dd2086b
BEGIN BONJOUR ADVERTISING
INSPECTING HEADER @ 1390036591413
`--: OPTIONS * RTSP/1.0
`--: CSeq: 0
`--: X-Apple-Device-ID: 0xaccf5c73af4b
`--: Apple-Challenge: JWkfiX/5gzeKemPDHyBwww==
`--: DACP-ID: 21A3D7C25BB62248
`--: Active-Remote: 1588769825
`--: User-Agent: AirPlay/190.9
END HEADER
@roldershaw
roldershaw / imsg
Last active March 1, 2022 19:34
Send iMessages from the command line using Bash and AppleScript
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: imsg [address] [message]"
else
/usr/bin/osascript -e 'tell application "Messages"
send "'"$2"'" to buddy "'"$1"'" of service "E:[email protected]"
end tell'
echo "Sent"
fi