Skip to content

Instantly share code, notes, and snippets.

View shinokada's full-sized avatar

Shinichi Okada shinokada

View GitHub Profile
<script lang="ts">
import '../app.postcss';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import {
Navbar,
NavBrand,
NavLi,
NavUl,
NavHamburger,
  1. Replace all spaces with underscores
replaceit
  1. Convert pdf to png files
pdftoimg -s -w 288
// see express-debugging https://gist.github.com/shinokada/3d2f7fd48b9ea9a75349fd4bad3c617d
{
"name": "code",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "DEBUG=app nodemon app.js",
"debug": "DEBUG=* nodemon app.js",
"test": "echo \"Error: no test specified\" && exit 1"
// app.js
// run this with DEBUG=app node app.js DEBUG=+ node app.js
// Add these to package.json scripts:
// note using nodemon
// "start": "DEBUG=app nodemon app.js",
// "debug": "DEBUG=* nodemon app.js",
const express = require('express');
const chalk = require('chalk');
const debug = require('debug')('app');

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
@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

Vivliostyle build command examples

Use any html from this sample dir.

Build from HTML/XHTML to a PDF

vivliostyle build https://vivliostyle.github.io/vivliostyle_doc/samples/adaptive-layout/adaptive/main.xhtml -o adaptive.pdf
vivliostyle build https://vivliostyle.github.io/vivliostyle_doc/samples/adaptive-layout/apollo8/index.xhtml -o apollo8.pdf
vivliostyle build https://vivliostyle.github.io/vivliostyle_doc/samples/adaptive-layout/candle/index.xhtml -o candle.pdf
<script>
import { MetaTags } from 'svelte-meta-tags';
let description =
'20+ Icon sets from Font Awesome, Bootstrap, Flag, Cryptocurrency, Heroicons, File icons, Weather, Twitter emoji, Tabler icons and more.';
</script>
<MetaTags
facebook={{

How to install Flowbite-Svelte to Astro

  1. Create astro app
$ pnpm create astro@latest
../Library/pnpm/store/v3/tmp/dlx-39674   |  +55 ++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/shinichiokada/Library/pnpm/store/v3
  Virtual store is at:             ../Library/pnpm/store/v3/tmp/dlx-39674/node_modules/.pnpm
#!/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"