Skip to content

Instantly share code, notes, and snippets.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 1, 2024 13:17
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@SpeedyFolf
SpeedyFolf / ax.json
Last active May 1, 2024 13:11
Ålandish national colors/country flag color scheme for LotsOfS' stream layout
"Åland Islands": {
"Default": "AX",
"Colors": {
"AX": {
"Outer": "#FFD300",
"Inner": "#DA0E15",
"Text": "#0064AD"
}
}
},
{-# language ApplicativeDo #-}
{-# language LambdaCase #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE InstanceSigs #-}
-- not sure if this is all extensions or all these extensions are needed, just pasting from the file
module VerifySchema where
@Hrissimir
Hrissimir / yt-dlp.conf
Created August 17, 2023 06:34
Instructions: How to install and configure 'yt-dlp' on Windows 10 machine
# =========================================================================
# Instructions: How to install and configure 'yt-dlp' on Windows 10 machine
#
# NOTE: Lines starting with # are treated as comments
# -------------------------------------------------------------------------
#
#
# =========================================================================
# Part I. "Install Prerequisites"
# -------------------------------------------------------------------------
@khakimov
khakimov / gist:3558086
Created August 31, 2012 19:49
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@fscm
fscm / install_cmake.md
Last active May 1, 2024 12:57
[macOS] Install CMake

[macOS] Install CMake

Instructions on how to install the CMake tool on macOS.

Uninstall

First step should be to unsinstall any previous CMake installation. This step can be skipped if no CMake version was previously installed.

To uninstall any previous CMake installations use the following commands:

@benwells
benwells / reduce-example.js
Created May 12, 2016 13:40
Using Array.reduce to sum a property in an array of objects
var accounts = [
{ name: 'James Brown', msgCount: 123 },
{ name: 'Stevie Wonder', msgCount: 22 },
{ name: 'Sly Stone', msgCount: 16 },
{ name: 'Otis Redding', msgCount: 300 } // Otis has the most messages
];
// get sum of msgCount prop across all objects in array
var msgTotal = accounts.reduce(function(prev, cur) {
return prev + cur.msgCount;
@manniru
manniru / reduce-example.js
Created May 30, 2019 21:57 — forked from benwells/reduce-example.js
Using Array.reduce to sum a property in an array of objects
var accounts = [
{ name: 'James Brown', msgCount: 123 },
{ name: 'Stevie Wonder', msgCount: 22 },
{ name: 'Sly Stone', msgCount: 16 },
{ name: 'Otis Redding', msgCount: 300 } // Otis has the most messages
];
// get sum of msgCount prop across all objects in array
var msgTotal = accounts.reduce(function(prev, cur) {
return prev + cur.msgCount;
var request = require("request");
var options = { method: 'POST',
url: 'http://192.168.0.124:1313/api/items',
headers:
{ 'Postman-Token': 'bb425338-e09d-4a35-874d-06049d2a2014',
'cache-control': 'no-cache',
'Content-Type': 'application/json' },
body: { id: 1, name: 'Item 1', price: 100, categoryId: 1, status: 1 },
json: true };