- [[DesignCode]]
- [[Design resources]]
- [[Icons]]
- [[Design inspiration]]
- [[Colors]]
- [[Design resources]]
- Useful for setting and seeing colors with their difference uses
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
const fs = require('fs'); | |
const path = require('path'); | |
const tinify = require('tinify'); | |
require('dotenv').config() | |
tinify.key = process.env.API; | |
// Define the directories. | |
const inputDir = './images'; | |
const outputDir = './optimized'; |
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
export function fetchFromUrl<T>( | |
url: string, | |
options: RequestInit, | |
): Promise<T | { error: string }> { | |
return fetch(url, { ...options }) | |
.then((response) => { | |
if (response.ok) { | |
try { | |
return response.json(); | |
} catch (e) { |
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
// Turn "px" values into "fr" values. | |
// e.g: column widths: [768, 384, 768] and total width 1920. | |
// 738 / 1920 = 0.4. * 1000 = 4fr | |
// Times 1000 because if it's something like 10px: 10 / 1920 = 0.005 | |
// And we want to raise it to a full integer | |
export function turnPxValuesToFrUnits( | |
fractionalValues: number[], | |
total: number | |
) { | |
return fractionalValues |
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
// Delete ALL your tweets and un-retweet everything | |
// Just paste this code on the dev tools and leave the tab open. It deletes at [speed]. Make it faster or slower | |
// I don't know if Twitter has some internal safety to prevent a bunch of deletions from happening to fast, but at 100 it deletes 1000 tweets in under two minutes | |
// BEWARE you can't undo this action, and it will delete EVERYTHING | |
const speed = 100; | |
// do it on repeat. Timeouts are ugly but whatever, it works | |
setInterval(function (){ |
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
Note: These commands will remove all your Docker resources, not just the images. Be sure to backup any important data from your Docker volumes before running these commands. | |
bash | |
``` | |
# Stop all running Docker containers: | |
docker stop $(docker ps -aq) | |
# Remove all Docker containers: | |
docker rm $(docker ps -aq) |
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
<?php | |
add_action('init', function() { | |
add_action( | |
'wp_head', | |
function () { | |
echo "<link rel='stylesheet' href='<url_to_stylesheet>'></link>"; | |
}, | |
1000000 + 1 | |
); |
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
# Find how much all your node modules weigh | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# To delete them AT YOUR OWN RISK: | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
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
export const objectGetTypedKeys = Object.keys as <T extends object>( | |
obj: T | |
) => Array<keyof T>; |
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
"rules": [ | |
{ | |
"description": "button5 left space", | |
"manipulators": [ | |
{ | |
"from": { | |
"pointing_button": "button5" | |
}, | |
"to": [ | |
{ |
NewerOlder