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 { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | |
| import { useEffect, useState } from 'react'; | |
| interface IRequestHookConfig { | |
| // request params | |
| params?: any; | |
| // guards are like middlewares that run when a response is returned, before the state changes | |
| // multiple guards can be added for different kind of checks | |
| guards?: Array<(response: any, err: AxiosError | null) => Promise<void>>; | |
| } |
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
| <? | |
| // | |
| // AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio) | |
| // | |
| // File: twitterFollowerCuratorBot.php | |
| // | |
| // Created: May 2021 | |
| // License: MIT | |
| // |
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
| //MIT License | |
| //Copyright (c) 2021 Felix Westin | |
| //Source: https://github.com/Fewes/MinimalAtmosphere | |
| //Ported to GLSL by Marcin Ignac | |
| #ifndef ATMOSPHERE_INCLUDED | |
| #define ATMOSPHERE_INCLUDED | |
| // ------------------------------------- |
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
| // from/to: { left, top, width, height, shape: 'circle' | 'rect' } | |
| function CurvedArrow({ from, to }) { | |
| function curvedHorizontal(x1, y1, x2, y2) { | |
| function pos(t) { | |
| let mx = x1 + (x2 - x1) / 2; | |
| let p1 = {x: x1, y: y1}; | |
| let p2 = {x: mx, y: y1}; | |
| let p3 = {x: mx, y: y2}; | |
| let p4 = {x: x2, y: y2}; | |
| return { |
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
| function getGithubURL(resource) { | |
| return `https://github.com/${resource}`; | |
| } | |
| function updateStoryViewWidth() { | |
| const storyViewElem = document.querySelector('.story-view'); | |
| const { height } = storyViewElem.getBoundingClientRect(); | |
| storyViewElem.style.width = `${height / 1.77}px`; | |
| } |
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 { motion, useMotionValue, useTransform } from "framer-motion" | |
| export function Overlay({ isVisible }) { | |
| const opacity = useMotionValue(0) | |
| const pointerEvents = useTransform( | |
| opacity, | |
| latest => latest < 0.5 ? "none" : "auto" | |
| ) | |
| return ( |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "math" | |
| "net/http" | |
| "os" | |
| "time" |
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
| // Leaf : val -> ann -> Tree val ann | |
| function Leaf(val, ann) { | |
| return { | |
| ann: ann, | |
| val: val, | |
| toString: () => `Leaf(${val}, ${ann})`, | |
| map: f => Leaf(val, f(ann)), | |
| extend: f => Leaf(val, f(Leaf(val, ann))), | |
| reduce: (f, acc) => f(acc, ann), | |
| }; |
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
| var Jimp = require('jimp'); | |
| const fileName = process.argv[2]; | |
| const width = process.argv[3]; | |
| const height = process.argv[4]; | |
| Jimp.read(fileName) | |
| .then(photo => { | |
| let colours = {}; | |
| for (let x = 0; x < width; x++) { |
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 has moved to: | |
| * https://github.com/devonzuegel/digital-nesting/blob/master/twitter.css | |
| */ |