# ~/.gitconfig
[merge]
tool = diffview
[mergetool]
prompt = false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# 0. (Optional) Rename this script name to "proxy" | |
# 1. Replace the <protocol>, <ip> and <port> to the actual value of your proxy respectively. | |
# 2. Run this command `sudo chmod +x <path to proxy>` to make sure this script is executable. | |
# 3. Add this script path to the PATH environment variable. | |
# 4. Run your actual command like this: `proxy ping www.google.com`. | |
PROXY="<protocol>://<ip>:<port>" | |
export ALL_PROXY=$PROXY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# _*_ coding:utf-8 _*_ | |
import ctypes | |
import os | |
from ctypes import windll, wintypes | |
from typing import Optional | |
NULL: int = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------- | |
# Function: gdcp | |
# Description: | |
# This function allows you to interactively select a file from the list of modified files | |
# in a Git repository, view the diff, and copy it to the clipboard. | |
# | |
# Parameters: | |
# None | |
# | |
# Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding=utf-8 | |
import random | |
import time | |
def get_elems(total): | |
for i in range(total): | |
yield { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef char *sds; | |
typedef struct String { | |
int len; | |
int free; | |
char data[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"unsafe" | |
) | |
type Example struct { | |
Field1 int64 | |
Field2 int32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap cleanup EXIT | |
set -eux | |
set -o pipefail | |
SWFFILE="$1" | |
MP4FILE="${SWFFILE%.*}.mp4" | |
RAWFILE=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 32 | head -n 1).raw | |
WAVFILE=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 32 | head -n 1).wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding=utf-8 -*- | |
import json | |
import requests | |
from loguru import logger | |
logger.remove() | |
logger.add('{time}.log') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
#Persistent ; Keeps a script permanently running (that is, until the user closes it or ExitApp is encountered). | |
; Globals | |
DesktopCount = 2 ; Windows starts with 2 desktops at boot | |
CurrentDesktop = 1 ; Desktop count is 1-indexed (Microsoft numbers them this way) | |
; DLL |
NewerOlder