Skip to content

Instantly share code, notes, and snippets.

View Arondight's full-sized avatar
🏠
Working from home

陈晨 Arondight

🏠
Working from home
  • China
View GitHub Profile
@Arondight
Arondight / linux_is_sound_playing.c
Last active November 27, 2022 12:13
check if sound is playing on linux
#define _GNU_SOURCE
#include <fts.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
static char *ISP_strip(char *const string)
{
@Arondight
Arondight / git_push_all_branches_and_tags_to_remote.sh
Last active May 11, 2022 09:46
git push all branches and tags to remote
#!/usr/bin/env cat
git push remote --tags "refs/remotes/origin/*:refs/heads/*"
@Arondight
Arondight / git_merge_repos_with_history.sh
Last active August 30, 2022 03:02
git merge repos with history
#!/usr/bin/env cat
cd ./repo_a/
git remote add repo_b ../repo_b/
git fetch repo_b
git merge --allow-unrelated-histories repo_b/master
# handling merge conflicts
git merge --continue
# merge done, also you can merge more repos
@Arondight
Arondight / git_checkeout_to_the_most_recent_commit_before_a_certain_date.sh
Last active May 11, 2022 09:47
git checkeout to the most recent commit before a certain date
#/usr/bin/env cat
# checkout with a iso8601 date format
git checkout $(git rev-list -n 1 --before="yyyy-mm-dd HH:MM:SS" HEAD)
# also can work well with repo command
repo forall -c 'git checkout $(git rev-list -n 1 --before="yyyy-mm-dd HH:MM:SS" HEAD)'