Skip to content

Instantly share code, notes, and snippets.

@Semo
Semo / Howto_Zsh5-6-2_Centos7.md
Last active May 9, 2024 07:36
How to install Zsh version 5.6.2 into CentOS 7

How to install Zsh version 5.6.2 into CentOS 7

Given that you have a clean installation of CentOS 7 which was already updated, by you, then you still have some dependencies to install make and install the external Zsh from the source. You must be root to get the stuff done.

Install GCC Development Tools

yum groupinstall "Development tools"

Check if it's working

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 9, 2024 07:36
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@ChuanyuXue
ChuanyuXue / morandi.py
Last active May 9, 2024 07:30
Morandi Palette: A palette with 18 colors inspired by Giorgio Morandi
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from gurobipy import Model, GRB
colors = [
'#686789', '#B77F70', '#E5E2B9', '#BEB1A8', '#A79A89', '#8A95A9',
'#ECCED0', '#7D7465', '#E8D3C0', '#7A8A71', '#789798', '#B57C82',
'#9FABB9', '#B0B1B6', '#99857E', '#88878D', '#91A0A5', '#9AA690'
]
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@kiding
kiding / HDRGainMap.swift
Last active May 9, 2024 07:29
Extracting HDR Gain Map from iOS 14.1+ (iPhone 12+) photos
import UIKit
import MobileCoreServices.UTCoreTypes
if #available(iOS 14.1, *) {
let input = Bundle.main.url(forResource: "IMG_0037", withExtension: "HEIC")!
let output = FileManager().temporaryDirectory.appendingPathComponent("IMG_0037.GAIN_MAP.BMP")
let source = CGImageSourceCreateWithURL(input as CFURL, nil)!
// urn:com:apple:photo:2020:aux:hdrgainmap
let dataInfo = CGImageSourceCopyAuxiliaryDataInfoAtIndex(source, 0, kCGImageAuxiliaryDataTypeHDRGainMap)! as Dictionary
@ajvillegas
ajvillegas / 01-custom-block.js
Last active May 9, 2024 07:28
Sample custom WordPress editor block and sidebar controls using using ES5 JavaScript syntax.
/**
* Custom WordPress block boilerplate.
*
* @package My_Block_Package
* @author Alexis J. Villegas
* @link http://www.alexisvillegas.com
* @license GPL-2.0+
*/
( function( blocks, editor, element ) {
@cb372
cb372 / riscv.md
Last active May 9, 2024 07:27
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 07:26
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@npearce
npearce / install-docker.md
Last active May 9, 2024 07:23
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@gaetschwartz
gaetschwartz / settings.json
Last active May 9, 2024 07:21
Nest files in Flutter projects on VSCode, inspired from https://github.com/antfu/vscode-file-nesting-config
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md",
"*.dart": "$(capture).g.dart, $(capture).freezed.dart",
},