This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>WiFi Login</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- https://news.ycombinator.com/item?id=26923316 --> | |
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔐</text></svg>"> | |
<style> | |
body, textarea { | |
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, useRef } from 'react'; | |
// Usage | |
function App() { | |
// Create a ref that we add to the element for which we want to detect outside clicks | |
const ref = useRef(); | |
// State for our modal | |
const [isModalOpen, setModalOpen] = useState(false); | |
const openModal = useCallback(() => setModalOpen(true), []); | |
const closeModal = useCallback(() => setModalOpen(false), []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, useRef } from 'react'; | |
// Usage | |
function App() { | |
// Ref for the element that we want to detect whether on screen | |
const ref = useRef(); | |
// Call the hook passing in ref and root margin | |
// In this case it would only be considered onScreen if more ... | |
// ... than 300px of element is visible. | |
const onScreen = useOnScreen(ref, '-300px'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Radium from 'radium'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// import Radium, { Style } from 'radium'; | |
var FakeUser = React.createClass({ | |
getInitialState: function() { | |
return {firstname: '', lastName: '', gender: '', location: '', email: '', username: '', password: '', picture: ''}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jsx React.DOM | |
*/ | |
var text1 = document.getElementById('text1').textContent; | |
var text2 = document.getElementById('text2').textContent; | |
var LinksDemo = React.createClass({ | |
getInitialState: function() { | |
return {text: text1}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Histogram | |
{ | |
public static SortedDictionary<int, int> ToHistogram(this IEnumerable<int> nums) | |
{ | |
var dict = new SortedDictionary<int, int>(); | |
foreach (var n in nums) | |
{ | |
if (!dict.ContainsKey(n)) | |
dict[n] = 1; | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"00C1": "A WITH ACUTE, LATIN CAPITAL LETTER", | |
"00E1": "A WITH ACUTE, LATIN SMALL LETTER", | |
"0103": "A WITH BREVE, LATIN SMALL LETTER", | |
"01CE": "A WITH CARON, LATIN SMALL LETTER", | |
"00C2": "A WITH CIRCUMFLEX, LATIN CAPITAL LETTER", | |
"00E2": "A WITH CIRCUMFLEX, LATIN SMALL LETTER", | |
"00C4": "A WITH DIAERESIS, LATIN CAPITAL LETTER", | |
"00E4": "A WITH DIAERESIS, LATIN SMALL LETTER", | |
"0227": "A WITH DOT ABOVE, LATIN SMALL LETTER", |