Skip to content

Instantly share code, notes, and snippets.

View steelydylan's full-sized avatar
🎯
Focusing

Hori Godai steelydylan

🎯
Focusing
View GitHub Profile
@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
@mizchi
mizchi / predict-frontend.md
Last active May 12, 2023 03:43
React のユーザーから見た今後のフロントエンドの予想

この記事は議論のたたき台で、ポジショントークや、偏見にまみれています。

今のフロントエンドの分類

  • 古典的なサーバーサイド WAF への +α の味付け
  • 大規模なクライアントアプリケーション管理のための SPA
  • SEO / SSR を考慮した Node ヘヴィーな環境

他、提唱されてるパターン

@phpbits
phpbits / full-codes.js
Last active July 1, 2022 11:32
Extend core Gutenberg blocks with custom attributes and settings. View full tutorials here : https://jeffreycarandang.com/extending-gutenberg-core-blocks-with-custom-attributes-and-controls/
/**
* External Dependencies
*/
import classnames from 'classnames';
/**
* WordPress Dependencies
*/
const { __ } = wp.i18n;
const { addFilter } = wp.hooks;
@steelydylan
steelydylan / Hook.php
Created May 15, 2019 01:22
ブログレベルを表示するグローバル変数の生成サンプル
<?php
namespace Acms\Custom;
use DB;
use SQL;
use ACMS_Filter;
/**
* ユーザー定義のHookを設定します。
*/
@kenmori
kenmori / TypeScriptPractice.md
Last active May 19, 2024 01:52
TypeScript 練習問題集
import ts, { factory } from "typescript";
export function transformerFactory(context: ts.TransformationContext) {
function visitNode(node: ts.Node): ts.Node {
const newNode = ts.visitEachChild(node, visitNode, context);
if (
ts.isJsxOpeningElement(newNode) ||
ts.isJsxSelfClosingElement(newNode)
) {
return appendSourceMapAttribute(newNode.getSourceFile(), newNode);
@justin-carver
justin-carver / training.jsonl
Created October 22, 2022 10:40
GPT-3 Fine-Tuning SaaS Name Training Data
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: Pukket, Description: Social Media Management App focused on Local SMBs.\n###"}
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: Stock AI, Description: Get Stock Images Generated by AI + In-built blogpost image generator.\n###"}
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: Rewardful, Description: Build Your own affiliate program to scale your business.\n###"}
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: PageFlow, Description: Storytelling Tool to generate content in English & German.\n###"}
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: Arcade Software, Description: To create Interactive Product Demos for Landing Pages.\n###"}
{"prompt": "Generate a unique SaaS Name and description: ->", "completion": " SaaS Name: Lanva.io, Description: Turn Your Long form
import { Hono } from 'hono'
import React, { Suspense } from 'react'
import { renderToReadableStream } from 'react-dom/server'
import { suspend } from 'suspend-react'
const app = new Hono()
function Component() {
const data = suspend(async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/todos')