Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC1091
# shellcheck disable=SC2154
# PADD
#
# A more advanced version of the chronometer provided with Pihole
# SETS LOCALE
@xphyr
xphyr / README.md
Last active May 6, 2024 13:12
Running GPU Accelerated Games with OpenShift Virtualization

Running GPU Accelerated Games with OpenShift Virtualization

Introduction

The following document describes at a high level how one can use OpenShift Virtualization, an NVIDIA GPU, and VirtualGL to run hardware accelerated remote games.

Requirements

  • OpenShift 4.8 or Higher
  • OpenShift Virtualization 4.8 or higher
@sthiyaga
sthiyaga / CleanDevOrg
Created June 19, 2016 22:41
Apex script to delete all default data from a SFDC dev org.
// Execute Anonymous script to reset data from a Developer Edition
// NOTE -- this will delete ALL data, so run this only if you know what you are doing!
if ([SELECT OrganizationType FROM Organization][0].OrganizationType == 'Developer Edition') {
DELETE [Select ID from Campaign];
DELETE [Select ID from Lead];
DELETE [Select ID from Opportunity];
DELETE [Select ID from Solution];
DELETE [Select ID from Product2];
DELETE [Select ID from PriceBook2 where Name = 'Standard'];
DELETE [Select ID from Case];
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 13:11
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

@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active May 6, 2024 13:07
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 13:07
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@luismts
luismts / GitCommitBestPractices.md
Last active May 6, 2024 13:06
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@zacwest
zacwest / ios-font-sizes.swift
Last active May 6, 2024 13:04
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 6, 2024 13:04
国内的 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+

@kmafeni04
kmafeni04 / lapis-new.sh
Last active May 6, 2024 13:03
Lapis project initialisation script
#!/bin/bash
echo "What would you like to name the project?:"
read -r project_name
mkdir "$project_name"
cd "$project_name" || return
luarocks init --lua-version=5.1
luarocks install lapis
luarocks install etlua