Skip to content

Instantly share code, notes, and snippets.

@mono0926
mono0926 / commit_message_example.md
Last active March 28, 2024 14:54
[転載] gitにおけるコミットログ/メッセージ例文集100
@BuonOmo
BuonOmo / emojis.sh
Last active March 28, 2024 14:54
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=😀
emoji_grinning_face_with_big_eyes=😃
emoji_grinning_face_with_smiling_eyes=😄
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=😆
emoji_grinning_face_with_sweat=😅
emoji_rolling_on_the_floor_laughing=🤣
emoji_face_with_tears_of_joy=😂
emoji_slightly_smiling_face=🙂

RESTful Routes to CRUD Mapping

Example resource: posts

HTTP Method
(Verb)
Path/Endpoint/URI CRUD Operation Typical
Controller Action
Has Data
Payload
GET /posts Read all posts index No
GET /posts/:id Read a specific post show No
POST /posts Create a new post create Yes
PUT /posts/:id Update specified post update Yes
@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;

Guide to Add a Feature to a Web App

Intro

This guide is generic in that it does pertain to any particular web framework, e.g., Express.

When the time comes to implement a user story (feature) in a typical web application, following the steps below usually is a good approach to take in most cases...

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 14:50
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@styblope
styblope / docker-api-port.md
Last active March 28, 2024 14:43
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@mcxiaoke
mcxiaoke / openwrt-in-docker.md
Created June 7, 2021 10:07
Run OpenWrt in Docker

OpenWrt Docker镜像构建

为了在Docker中运行OpenWrt系统,我们需要用到OpenWrt的docker镜像,网上有很多人分享已经制作好的镜像。但是,每个人都有自己不同的需求,自己学会制作镜像就显得特别重要了。

其实使用OpenWrt的固件, 可以很方便的构建Docker镜像,这里的固件不光是官方固件,也可以是经过自己定制编译生成的固件。

直接使用