Skip to content

Instantly share code, notes, and snippets.

@rsxdalv
rsxdalv / index.html
Created August 16, 2020 07:49
keyboard-tone.js
<div class="switchbox" title="Toggle Notes">
<input id="checkbox" type="checkbox" onclick="toggle()">
</div>
<ul class="board">
<li id="F2" class="white" onmouseout="keyRele(this.id)" onmouseup="keyRele(this.id)" onmousedown="getkey(this.id)"></li>
<li id="F#2" class="black" onmouseout="keyRele(this.id)" onmouseup="keyRele(this.id)" onmousedown="getkey(this.id)"></li>
<li id="G2" class="white sq" onmouseout="keyRele(this.id)" onmouseup="keyRele(this.id)" onmousedown="getkey(this.id)"></li>
<li id="G#2" class="black" onmouseout="keyRele(this.id)" onmouseup="keyRele(this.id)" onmousedown="getkey(this.id)"></li>
<html>
<body>
<audio controls src="data:audio/ogg;base64,T2dnUwACAAAAAAAAAAA+HAAAAAAAAGyawCEBQGZpc2hlYWQAAwAAAAAAAAAAAAAA6AMAAAAAAAAAAAAAAAAAAOgDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPZ2dTAAIAAAAAAAAAAINDAAAAAAAA9LkergEeAXZvcmJpcwAAAAACRKwAAAAAAAAA7gIAAAAAALgBT2dnUwAAAAAAAAAAAAA+HAAAAQAAAPvOJxcBUGZpc2JvbmUALAAAAINDAAADAAAARKwAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAABDb250ZW50LVR5cGU6IGF1ZGlvL3ZvcmJpcw0KT2dnUwAAAAAAAAAAAACDQwAAAQAAAGLSAC4Qdv//////////////////cQN2b3JiaXMdAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAwOTA3MDkCAAAAIwAAAEVOQ09ERVI9ZmZtcGVnMnRoZW9yYS0wLjI2K3N2bjE2OTI0HgAAAFNPVVJDRV9PU0hBU0g9ODExM2FhYWI5YzFiNjhhNwEFdm9yYmlzK0JDVgEACAAAADFMIMWA0JBVAAAQAABgJCkOk2ZJKaWUoSh5mJRISSmllMUwiZiUicUYY4wxxhhjjDHGGGOMIDRkFQAABACAKAmOo+ZJas45ZxgnjnKgOWlOOKcgB4pR4DkJwvUmY26mtKZrbs4pJQgNWQUAAAIAQEghhRRSSCGFFGKIIYYYYoghhxxyyCGnnHIKKqigggoyyCCDTDLppJNOOumoo4466ii00EILLbTSSkwx1VZjrr0GXXxzzjnnnHPOOeecc84JQkNWAQAgAAAEQgYZZBBCCCGFFFKIKaaYcgoyyIDQkFUAACAAgAAAAABHkRRJsRTLsRzN0SRP8ixREzXRM0VTVE1VVVVVdV1XdmXXdnXXdn1ZmIVbuH1ZuIVb2I
import * as R from "ramda";
import { ActionTypes } from "../actions";
import { ReducerFunction, ReducerIdenity } from "./i-root-state";
export const toolReducer: Record<string, ReducerFunction> = {
[ActionTypes.SELECT_TOOL]: R.converge(R.assoc("tool"), [
R.path(["action", "value"]),
ReducerIdenity,
]),
[ActionTypes.DESELECT_TOOL]: R.converge(R.assoc("tool"), [
const isElementTextAreaConnected = (x): x is React.SFCElement<typeof TextAreaConnected> =>
typeof x === "object"
&& typeof x.type !== "string"
&& areComponentsEqual(x.type, TextAreaConnected)
const BlackMagicBoxV2 = ({ children, y = { i: 0, j: 0 } }) => {
return React.Children.map(children, x => {
if (typeof x === "object") {
return isElementTextAreaConnected(x) ?
const TopSection = withProps({
color: "primary",
variant: "contained",
} as {})(styled(Card)`
width: 100%;
`)
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2018-03-10T23:44:03.3286169</Date>
<Author>NEIRON\admin</Author>
<URI>\Auto shutdown</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2018-03-11T03:30:00</StartBoundary>
@rsxdalv
rsxdalv / gist:bc6d82246b7c13bec7f1b88ea155c39f
Last active June 19, 2018 06:24
JS-string-to-css-charcodes
const x = 'ievelc šeit'
console.log(
Array(x.length).fill(0).map((_, i) =>
`\${Number(
x.charCodeAt(i)
).toString(16).padStart(4, 0)}`
).join("")
)
@rsxdalv
rsxdalv / gist:14024bfe27f9f4ba094985fea3daf1e3
Created June 19, 2018 06:22
JS-string-to-css-charcodes
const x = 'ievelc šeit'
console.log(
Array(x.length).fill(0).map((_, i) =>
`/${Number(
x.charCodeAt(i)
).toString(16).padStart(4, 0)}`
).join("")
)
document.onkeyup=function(e){
var e = e || window.event; // for IE to cover IEs window event-object
if(e.altKey && e.which == '1'.charCodeAt(0)) {
document.querySelector('#layerView > div.layerCodeContainer > div > div > div.title > button.button.copyButton').click()
// alert('Keyboard shortcut working!');
return false;
}
}