Skip to content

Instantly share code, notes, and snippets.

@lubieowoce
Created October 1, 2024 22:15
Show Gist options
  • Save lubieowoce/6ee8b1fdefb16630d37078b648321b99 to your computer and use it in GitHub Desktop.
Save lubieowoce/6ee8b1fdefb16630d37078b648321b99 to your computer and use it in GitHub Desktop.
snippets for posting stuff in picosky
// https://pico.bsky.mom/
(async () => {
// sine
const lines = 24
function sine(t) {
const w = 12;
const arr = new Array(12).fill('.');
const ix = Math.floor(((Math.cos(t * 0.6) + 1) / 2) * w);
arr[ix] = '#';
return arr.join('')
};
for (let i = 0; i < lines; i++) {
let str = sine(i);
console.log(str);
await fetch("https://pico.api.bsky.mom/post", {
"headers": {
"Content-Type": "application/json",
},
"body": JSON.stringify({ post: str }),
"method": "POST",
"mode": "cors"
});
}
})();
(async () => {
// smiley
// https://lachlanarthur.github.io/Braille-ASCII-Art/
const data = `
⠀⠀⡠⠐⠈⠉⠉⠁⠂⢄⠀⠀
⢀⡺⢲⣤⠀⠀⡠⠒⣲⣄⠑⡀
⡄⠥⠤⠥⠀⠀⠧⠤⠬⠼⠀⢰
⠇⢲⣶⣶⣶⣶⣶⣶⣶⣦⠀⠸
⠈⢄⠻⣿⣿⠟⠛⣻⣿⠏⡠⠃
⠀⠀⠑⠨⢛⣛⣛⡛⠅⠊⠀⠀
`.slice(1, -1);
const lines = data.split('\n').reverse();
for (let i = 0; i < lines.length; i++) {
let str = lines[i]
console.log(str);
await fetch("https://pico.api.bsky.mom/post", {
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ post: str }),
method: "POST",
mode: "cors",
});
}
})();
(async () => {
// https://patorjk.com/software/taag/#p=display&v=1&f=Ogre&t=p%0A%20i%0Ac%0Ao
// https://patorjk.com/software/taag/#p=display&h=2&v=2&f=Ogre&t=pi%0Aco
const data = String.raw`
_
_ __ (_)
| '_ \| |
| |_) | |
| .__/|_|
|_|__ ___
/ __/ _ \
| (_| (_) |
\___\___/
`.slice(1, -1);
const lines = data.split("\n").reverse();
for (let i = 0; i < lines.length; i++) {
let str = lines[i].replace(/^[ ]+/, (match) =>
String.fromCharCode(0x2007).repeat(match.length)
);
console.log(str);
await fetch("https://pico.api.bsky.mom/post", {
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ post: str }),
method: "POST",
mode: "cors",
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment