Skip to content

Instantly share code, notes, and snippets.

View shinokada's full-sized avatar

Shinichi Okada shinokada

View GitHub Profile
SC1000 $ is not used specially and should therefore be escaped.
SC1001 This \o will be a regular ‘o’ in this context.
SC1003 Want to escape a single quote? echo ‘This is how it’\‘’s done’.
SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
SC1007 Remove space after = if trying to assign a value (or for empty string, use var=’’ … ).
SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a ‘shell’ directive to specify.
SC1009 The mentioned parser error was in …
SC1010 Use semicolon or linefeed before ‘done’ (or quote to make it literal).
SC1011 This apostrophe terminated the single quoted string!
SC1012 \t is just literal t here. For tab, use "$(printf '\t')" instead.
@shinokada
shinokada / +page.svelte
Created July 12, 2025 13:34
ThemeProvider example
<script lang="ts">
import { type ThemeConfig, ThemeProvider, Accordion, AccordionItem, Alert, Avatar, Badge, Heading, Banner, P, BottomNav, BottomNavItem, Breadcrumb, BreadcrumbItem, ButtonGroup, Button, GradientButton, Card } from "$lib";
// theme types
import type { AccordionItemTheme, BadgeTheme, BannerTheme, BottomNavTheme, BottomNavItemTheme, BreadcrumbTheme, BreadcrumbItemTheme, ButtonTheme, GradientButtonTheme, CardTheme } from '$lib';
import { HomeSolid, WalletSolid, AdjustmentsVerticalOutline, UserCircleSolid } from "flowbite-svelte-icons";
const theme: ThemeConfig = {
accordion: "w-96 text-green-500",
accordionitem: {
@shinokada
shinokada / gist:9b84198703ed6cf6169486de6309b5a1
Created August 21, 2023 12:33
Ultimate Prompt Engineering Secret.txt
From https://twitter.com/cj_zZZz/status/1678795785650200578
1st Step:
Give it a role. "You are Spartacus, a pro copywriter,"
2nd Step:
Define its job "Your job is to write copy for online media brands"
Third step:
Give ChatGPT the control: "Now ask me all the questions that you need to know to write a perfect copy that'd align with my brand."

POSIX commands Cheatsheat

  • admin - create and administer SCCS files (DEVELOPMENT)
  • alias - define or display aliases
  • ar - create and maintain library archives
  • asa - interpret carriage-control characters
  • at - execute commands at a later time
  • awk - pattern scanning and processing language
  • basename - return non-directory portion of a pathname
  • batch - schedule commands to be executed in a batch queue
@shinokada
shinokada / ArchiveBox.svelte
Created November 6, 2024 06:05
Working example with draw
<script lang="ts">
import { draw } from 'svelte/transition';
import { getContext } from 'svelte';
import type { Props } from './types.ts'
let {
size = 24,
role = 'img',
color = 'currentColor',
strokeWidth = 1.5,
@shinokada
shinokada / +page.svelte
Created November 5, 2024 16:16
svelte-animate home
<script lang="ts">
import { ArrowLeft, AtSign, BadgeCheck, Bell, AcademicCap, Wrapper, ArrowDownLeft, Animate, ArrowBigUp, ArrowDownLeft2, ArrowDownOnSquare } from "$lib";
import { draw } from 'svelte/transition';
</script>
<div class="container">
<h1>Svelte Animate for Svelte 5</h1>
<h2>Click to see animation</h2>
<AtSign size={50} color="purple"/>
@shinokada
shinokada / package.json
Created November 5, 2024 16:15
latest svelte lib/project package.json, remove postcss & tslib
{
"name": "svelte-icons",
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "npm run package",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
#!/bin/bash
# Source: https://raintrees.net/projects/a-painter-and-a-black-cat/wiki/OwnTweetSearch
# this script search your own tweets from tweet.js
MY_NAME="shinokada" #change to your twitter id
HIT_LIST=$(cat tweets.js |sed -e 's/window.YTD.tweets.part0 = //'|jq -r -c '.[]'|grep "$1")
HIT_COUNT=$(echo "${HIT_LIST}"|wc -l)
COUNT="1"
@shinokada
shinokada / sed_snippets.sh
Created November 13, 2022 20:49 — forked from r2k0/sed_snippets.sh
sed examples
##FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
# triple space a file

50 sed Command Examples

From 50 sed command examples

sed is a useful text processing feature of GNU/Linux. The full form of sed is Stream Editor. Many types of simple and complicated text processing tasks can be done very easily by using sed command. Any particular string in a text or a file can be searched, replaced and deleted by using regular expression with sed command. But this commands performs all types of modification temporarily and the original file content is not changed by default. The user can store the modified content into another file if needs. The basic uses of sed command are explained in this tutorial by using 50 unique examples.Before starting this tutorial you must check the installed version of sed in your operating system by running the following command. The tutorial is designed based on GNU sed. So this version of sed will be required to practice the examples shown in this tutorial.

$ sed --version