Ctrl + Alt + Space
This file contains 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, useCallback, useRef } from "react"; | |
// Usage | |
function App() { | |
const [hoverRef, isHovered] = useHover(); | |
return ( | |
<div ref={hoverRef}> | |
{isHovered ? '😁' : '☹️'} | |
</div> |
This file contains 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
const Button = forwardRef<CoralButton, ButtonProps>((props, ref) => { | |
const { children, onClick, title, ...coralButtonProps } = props; | |
const buttonRef = useRef<CoralButton>(null); | |
useLayoutEffect(() => { | |
if (ref) { | |
if (isFunction(ref)) { | |
ref(buttonRef.current); | |
} else { |
This file contains 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
const crypto = require('crypto') | |
const { promisify } = require('util') | |
const pbkdf2 = promisify(crypto.pbkdf2) | |
module.exports = { createHashPasswordFn, isPasswordCorrect } | |
/** | |
* @typedef {Object} HashPassword | |
* @property {String} hash | |
* @property {String} salt |
- Open Chrome Developer tools and click the Network tab.
- Navigate to the page with the video and get it to start playing.
- Filter the list of files to "m3u8".
- Find master.m3u8 or index.m3u8 and click on it.
- Save the file to disk and look inside it.
- If the file contains a single m3u8 master url, copy that one instead.
- Run the program m3u8x.
- Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
This file contains 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 React, {Component} from 'react' | |
export default DecoratedComponent => | |
class extends Component { | |
state = { | |
hover: false, | |
} | |
toggleHover = () => | |
this.setState({hover: !this.state.hover}) | |
render() { |
This file contains 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 requests | |
import base64 | |
from tqdm import tqdm | |
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1' | |
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1] | |
resp = requests.get(master_json_url) | |
content = resp.json() |
This file contains 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
@relayRoot | |
@relayContainer({ | |
client: () => Relay.QL` | |
fragment on Client { | |
id, | |
menuitems(first: 50) { | |
} | |
} | |
` | |
}) |
This file contains 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
const readFile = (file) => { | |
let reader = new global.FileReader(); | |
return new Promise((resolve, reject) => { | |
reader.onload = (event) => { | |
file.data = event.target. result; | |
resolve(file); | |
}; | |
reader.onerror = () => { |
NewerOlder