'use strict';
const React = require('react');
const Store = require('./Store');
const Thing = require('./Thing');
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 CommandData = { | |
M: { | |
name: 'MoveTo', | |
chunk: 2, | |
}, | |
L: { | |
name: 'LineTo', | |
chunk: 2, | |
}, | |
H: { |
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
diff -y --suppress-common-lines <(xxd PATH1) <(xxd PATH2) |
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
// For some reason, the typing notification (and its associated animation) seems to use a lot of processing | |
// This causes the fans on my laptop to run audibly whenever someone is typing | |
// This script brute force disables it, since there's no option to reduce animation in Discord | |
// To run, apply the following code to the console. You can access the console within the devtools, accessible with hotkey: | |
// Mac: Command+Option+I | |
// Windows: Control+Shift+I | |
// Running this script only affects your current Discord session, so it will have to be done every time you start Discord | |
// Once you finish pasting this, close the devtools with the X in the top corner | |
document.head.appendChild(document.createElement('style')).innerHTML = '[class^="typing-"] { display: none !important; }'; |
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 youtubeVideoSelector = 'video'; | |
const video = document.querySelector(youtubeVideoSelector); | |
const width = video.videoWidth; | |
const height = video.videoHeight; | |
const canvas = document.createElement('canvas'); | |
const context = canvas.getContext('2d'); | |
canvas.width = width; |
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, { memo, useCallback } from 'react'; | |
import ChildComponent from './wherever/ChildComponent.js'; | |
const updateChild = (props, childId, changes) => { | |
props.onUpdate({ | |
type: 'childChanged', | |
childId: childId, | |
changes: changes, | |
}); | |
}; |
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
'use strict'; | |
var React = require('react'); | |
// Inserts stuff between other stuff in React context | |
// Usage | |
// <InsertBetween separator={', '}> | |
// <span>1</span> | |
// <span>2</span> |
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
'use strict'; | |
var _ = require('lodash'); | |
// JSS styling | |
var jss = require('jss').create(); | |
// Order matters! | |
// https://github.com/jsstyles/jss-camel-case/issues/1 | |
jss.use(require('jss-extend')); |
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
'use strict'; | |
var _ = require('lodash'); | |
// JSS styling | |
var jss = require('jss'); | |
// Order matters! | |
// https://github.com/jsstyles/jss-camel-case/issues/1 | |
jss.use(require('jss-extend')); |
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
// Lo-Dash 3.8.0 | |
// ----------------------------------------------------------------------------- | |
// Search String to Object | |
// ----------------------------------------------------------------------------- | |
// Handles many slightly malformed styles (see tests) | |
// Expects each query to be separated by '&' | |
// Expects each pair to be separated by '=' | |
_.chain(queryString) // or get the current query string: window.location.search |
NewerOlder