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 from 'react' | |
import { Box, useElementQuery } from 'atomic-layout' | |
// Initially, I thought of EQ as a standalone query-value binding | |
// with the React component being an application surface. | |
// The problem with this is that the props assignment becomes abstracted, | |
// and it's not easy to scan which props are assigned to a component, | |
// and which comes from the EQ declared eslewhere. | |
const InitialIdea = () => { | |
const styles = useElementQuery( |
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
<!DOCTYPE html><html lang=en> | |
<title>Page Not Found</title> | |
<meta charset=utf-8> | |
<meta name=viewport content="width=device-width,initial-scale=1"> | |
<h1>Page Not Found</h1> | |
<p>Sorry, but the page you were trying to view does not exist.</p> |
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
let _str = (function(){ | |
const tag = document.createElement('span') | |
return { | |
propToAttr: (string) { | |
tag.dataset[string] = true | |
return tag.attributes[0].name.split(/^data-/)[1] | |
}, | |
attrToProp(string) { | |
tag.setAttribute(`data-${string}`, true) | |
return Object.entries(tag.dataset)[0][0] |
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
// ==UserScript== | |
// @name jsfiddle annoyances | |
// @namespace https://gist.githubusercontent.com/thykka/d130a68229dc9bda81e6f11f7388d52d/ | |
// @version 0.0.3 | |
// @description Kill the anti-features! | |
// @author Thykka | |
// @match https://jsfiddle.net/* | |
// @updateURL https://gist.githubusercontent.com/thykka/d130a68229dc9bda81e6f11f7388d52d/raw | |
// @downloadURL https://gist.githubusercontent.com/thykka/d130a68229dc9bda81e6f11f7388d52d/raw | |
// @grant none |
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
//add this as the URL of your bookmark, then just click the bookmark to trigger the script when you are on an IG page with an image selected. | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',').reverse(); list.forEach(function(source){ var sizeimg = source.split(' '); prompt('The image size is:'+sizeimg[1],sizeimg[0]) }) }) }})(); | |
//alternative; opens largest image in new tab automatically | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',' |
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
package main | |
import ( | |
"encoding/hex" | |
"os" | |
"strconv" | |
) | |
func main() { | |
f, err := os.OpenFile("colours.css", os.O_WRONLY, 0600) |
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
A gilbert project is a directory with 5 sub directories: | |
- static/ | |
- pages/ | |
- content/ | |
- templates/ | |
- dest/ | |
Upon calling render, the site will: | |
- create an index of files in static; only referenced files will be copied to the destination |
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
///////////////////////////////////////////////////////// | |
// B Language Grammar | |
// Author: Jahan Addison | |
// LALR(1) EBNF-like Grammar | |
// Placed under CC0 1.0 | |
///////////////////////////////////////////////////////// | |
program : ( definition ) * | |
definition : function_definition |
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
interface IState { | |
sticky: boolean; | |
} | |
export class HeaderBar extends React.Component<{}, IState> { | |
sentinelRef: React.RefObject<HTMLDivElement>; | |
observer: IntersectionObserver; | |
state = { sticky: false }; |
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 wrapWithQuotes = (parts, ...values) => { | |
let result = parts[0]; | |
values.forEach((value, i) => { | |
result += `"${value}"` + parts[i + 1]; | |
}); | |
return result; | |
}; |