Skip to content

Instantly share code, notes, and snippets.

View HananoshikaYomaru's full-sized avatar
:shipit:
Stay focus

Hananoshika Yomaru HananoshikaYomaru

:shipit:
Stay focus
View GitHub Profile
import 'package:flutter/material.dart';
@immutable
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
ClipShadowPath({
@required this.shadow,
@HananoshikaYomaru
HananoshikaYomaru / httpserver.js
Created October 14, 2021 14:18
how to start a simple node js http server
const {createServer} = require("http");
let server = createServer((request, response) => {
response.writeHead(200, {"Content-Type": "text/html"});
response.write(`
<h1>Hello!</h1>
<p>You asked for <code>${request.url}</code></p>`);
response.end();
});
server.listen(8000);
console.log("Listening! (port 8000)");
@HananoshikaYomaru
HananoshikaYomaru / project update.md
Last active February 10, 2023 03:23
linear cheatsheet.md

Princess app 1.14.2 release test

old version / new version: ✅ ✅ feature 1 (#PD-1111) ✅ ✅ feature 2 (#PD-2222) ✅ ✅ feature 3 (#PD-3333) ❗ ✅ feature 4 (#PD-4444) → follow up : #PD-5555

Princess web 1.12.2 releast test

@HananoshikaYomaru
HananoshikaYomaru / getVercelBranchUrl.js
Created April 5, 2023 10:48
getVercelBranchUrl.js
const { createHash } = require("crypto");
function sha256(string) {
return createHash("sha256").update(string).digest("hex");
}
const firstUrlMaxLength = 74;
/**
*
@HananoshikaYomaru
HananoshikaYomaru / getFileFromObjectUrl.ts
Last active April 18, 2023 10:30
getImageFromObjectUrl.ts
export const getFileFromObjectUrl = async (url: string) => {
const result = await fetch(url);
return result.blob();
};
@HananoshikaYomaru
HananoshikaYomaru / getRandomString.ts
Created April 19, 2023 12:28
getRandomString.ts
function generateRandomString(length) {
let result = "";
const characters =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
#!/bin/bash
# Define the list of branch names start with pr-
words=($(eas channel:list --json --non-interactive | jq -r ".currentPage[].name" | grep pr-))
# Loop over the filtered words and run the commands
for word in "${words[@]}"; do
eas channel:delete $word --non-interactive
eas branch:delete $word --non-interactive
done
@HananoshikaYomaru
HananoshikaYomaru / cloudinaryMigration.ts
Last active June 16, 2023 03:23
cloudinary migration
import { prisma } from "@princess/db";
import pool from "@ricokahler/pool";
import { type ResourceApiResponse, v2 } from "cloudinary";
// this is the old cloudinary
const cloudName = "dg4lbnuii";
const apiSecret = "e2L-_EHhcno3FLYZcHYbokaY-EU";
const apiKey = "673961598382791";
const newCloudNamePreview = "wemakeapp-preview";
@HananoshikaYomaru
HananoshikaYomaru / Dedent.js
Last active November 8, 2023 06:42
obsidian link preview
class Dedent {
dedent(templ) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
var strings = Array.from(typeof templ === 'string' ? [templ] : templ);
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, '');
var indentLengths = strings.reduce(function (arr, str) {
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
@HananoshikaYomaru
HananoshikaYomaru / publish.css
Created November 22, 2023 07:13
I put this code in my obsidian publish
/* section : font */
@font-face {
font-family: "Geist";
src: url(https://cdn.jsdelivr.net/gh/HananoshikaYomaru/geist@main/GeistVF.woff2)
format("woff");
font-weight: normal;
}
@font-face {
font-family: "IA Writer Quattro";