Skip to content

Instantly share code, notes, and snippets.

View mrjohannchang's full-sized avatar

Johann Chang mrjohannchang

View GitHub Profile
@papachristoumarios
papachristoumarios / git-lfs-sync.sh
Created October 7, 2019 15:07
Git LFS Sync between remotes
#!/bin/bash
# Sync two git LFS remotes. This is very useful when you
# have two remotes (e.g. upstream and fork) and they have
# different files on the LFS storage. Trying git lfs fetch --all
# yields an error for missing objects if the two repos are not
# synced. The purpose of this script is to overcome this issue
# with Git LFS
#
# Usage: git-lfs-sync.sh source destination branch
#
/// Make CPUs usage as a sin wave
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
const float PI = 3.1415926;
const int TIME_SLICE = 40000; // 40 ms
@scmx
scmx / git-commit-title-first-word.md
Last active April 14, 2024 08:39
Example list of verbs / first word to use in git commit title #git #commit #title

Example list of first words to use in a git commit title

I like writing well-formed git commits that explain the intention behind why a code change was made.

Check out Chris Beams excellent How to Write a Git Commit Message if you haven't read it.

Anyway, for a project I've been working on I've gathered up 900+ commits that hold up a pretty high quality (except for one 😁). Let's look at some trends about these commits!

Most common first words in commit titles of a project

@effigies
effigies / python_packaging_2019.md
Last active October 12, 2020 19:10
Contemporary Python Packaging - August 2019

Contemporary Python Packaging

This document lays out a set of Python packaging practices. I don't claim they are best practices, but they fit my needs, and might fit yours.

Validity

This document has been superseded as of July 2020.

This was written in July 2019. As of this writing Python 2.7 and Python 3.5 still have not

@jsmcnair
jsmcnair / Get-CinebenchScore.ps1
Last active June 13, 2021 02:25
PowerShell Cinebench score generator
function Get-CinebenchScore {
$source = "http://http.maxon.net/pub/cinebench/CinebenchR20.zip"
$out = "C:\CinebenchR20.zip"
$cbfolder = "C:\cinebench\"
$cbpath = Join-Path $cbfolder "cinebench.exe"
$log = Join-Path $cbfolder "log.txt"
if(-not (Test-Path $cbpath)) {
# Download
Invoke-WebRequest -Uri $source -OutFile $out
@fcharlie
fcharlie / profile.json
Last active December 18, 2022 20:38
My Windows Terminal profile.json
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.
@dteoh
dteoh / .gitconfig
Created March 17, 2019 23:40
Use Neovim as git mergetool
[merge]
tool = vimdiff
[mergetool]
keepBackup = false
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@huenisys
huenisys / Enable symbolic links for Git on Windows 10.md
Last active January 1, 2024 09:10
Enable symbolic links for Git on Windows 10
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active April 12, 2024 13:24
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR