Skip to content

Instantly share code, notes, and snippets.

View WenxiJin's full-sized avatar
🎯
Focusing

HvidPanda WenxiJin

🎯
Focusing
  • Sophion Bioscience A/S
  • Denmark
View GitHub Profile
@WenxiJin
WenxiJin / install_global.sh
Last active July 12, 2017 11:21
Install gnu global 6.5.7
#!/usr/bin/env bash
set -e
echo "installing package for gnu global"
sudo apt-get update
@WenxiJin
WenxiJin / example-subtree-usage.md
Created July 21, 2017 20:28 — forked from kvnsmth/example-subtree-usage.md
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.

@WenxiJin
WenxiJin / CountDownLatchDemo.java
Created May 13, 2019 11:15
Main thread continues until worker thread finishes
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class CountDownLatchDemo {
public static void main(String args[]) throws InterruptedException {
CountDownLatch latch = new CountDownLatch(1);
Worker first = new Worker(10, latch, "1st-Worker");
first.start();
@WenxiJin
WenxiJin / builder_pattern.cpp
Created November 24, 2020 14:46 — forked from niosus/builder_pattern.cpp
An example of builder pattern in c++
#include <stdio.h>
#include <memory>
class BBuilder;
class A {
public:
A() {}
virtual ~A() { fprintf(stderr, "A done.\n"); }
int getA() const { return _a; }
@WenxiJin
WenxiJin / config
Last active September 30, 2024 08:15 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = XXX
email = [email protected]
username = XXX
[init]
defaultBranch = master
[core]
editor = emacs
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[sendemail]