Skip to content

Instantly share code, notes, and snippets.

View bryan-hoang's full-sized avatar
🎯
Focusing

Bryan Hoang bryan-hoang

🎯
Focusing
View GitHub Profile
@bryan-hoang
bryan-hoang / settings.json
Last active November 26, 2020 18:09
Microsoft Terminal Settings
// This file was initially generated by Windows Terminal 1.4.3243.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",
"alwaysShowTabs": true,
"theme": "system",
/*
* This code is licensed under CC0 1.0. Use it, do whatever you want with it!
*/
import java.util.List;
import java.util.function.Predicate;
public class PerfectMatchingWithEdmondsMatrix
{
/**
@alcatrazEscapee
alcatrazEscapee / BiMapRaceCondition.java
Created November 13, 2021 03:05
Race condition involving `BiMap.put` and `BiMap.get`, where `get` returns `null` despite no null ever being present in the map.
package bi_map_race_condition;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
public class BiMapRaceCondition
{
@SiZapPaaiGwat
SiZapPaaiGwat / webpack.nginx.conf
Last active November 19, 2021 19:10
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
@mooz
mooz / zle-tmux.sh
Created November 30, 2012 12:19
zle widget which launches tmux
function tmux-attach() {
# Launching tmux inside a zle widget is not easy
# Hence, We delegate the work to the parent zsh
BUFFER=" { tmux list-sessions >& /dev/null && tmux attach } || tmux"
zle accept-line
}
zle -N tmux-attach
# Define a shortcut key for launching tmux (Ctrl+t)
bindkey '^T' tmux-attach
@danbst
danbst / README.md
Last active October 22, 2023 12:06
[Linux] [Firefox] Open link in browser, which is in current workspace

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

@zorrodg
zorrodg / LICENSE
Last active November 30, 2023 19:37
CLI Integration Test Helper
MIT License
Copyright © 2019 Andrés Zorro
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@justincjahn
justincjahn / README.md
Last active January 16, 2024 20:15
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

#! /bin/bash
# Usage:
# ./git-move.sh path/to/file/or/dir path/to/destination/repo
echo "creating patch for path ${1}"
git log --name-only --pretty="format:" --follow "${1}" \
| sort -u | \
xargs git log --pretty=email --patch-with-stat --reverse --full-index --binary -m --first-parent -- > "${2}/_patch_" \
&& echo "moving to destination repo at ${2}" \
&& cd "${2}" \
&& echo "applying patch" \
@damc-dev
damc-dev / runBashScript.bat
Last active January 31, 2024 15:44
Execute Bash Script (Using Git Bash) from Windows Task Scheduler
cmd /c ""C:\Program Files (x86)\Git\bin\bash.exe" --login -i -- H:\Daily_Reports\yesterdayTogglReport.sh"