Skip to content

Instantly share code, notes, and snippets.

View itsmingjie's full-sized avatar

Mingjie Jiang itsmingjie

View GitHub Profile
@itsmingjie
itsmingjie / imake.sh
Last active January 18, 2024 10:34
Finds the closest makefile above the current layer and execute with it.
#!/bin/bash
# Find the closest Makefile or makefile
current_dir=$(pwd)
# Search for Makefile recursively upwards up to max 10 levels
max_level=10
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
@itsmingjie
itsmingjie / cs61a_pull.sh
Last active September 7, 2020 20:40
CS 61A Puller: Pulls a homework/lab package from the course website, unpacks it, moves it to the right place, and destroys the archive.
#!/bin/bash
# Pulls a homework/lab package from the course website,
# unpacks it, move it to the right place, and destroy the
# archive.
# Works with macOS/Linux only, unless you're in a "pseudo-Linux"
# environment on Windows. Make sure wget is installed first!
# After downloading, run the following command to grant execution
# permission to the script.
@itsmingjie
itsmingjie / batchEmailFinder.go
Last active March 17, 2019 22:10
This bad boy uses the script from https://github.com/hodgesmr/FindGitHubEmail/ to find the best guess of email addresses for a list of GitHub users in batch.
/*
This bad boy uses the script from https://github.com/hodgesmr/FindGitHubEmail/
to find the best guess of email addresses for a list of GitHub users in batch.
Known problem: GitHub throws an IP ban if you try to access its API for too many times. Usually
they'll ban you within 30 calls, but if you're lucky, who knows ;) Use a VPN.
Before running: grant executable permission to the findGitHubEmail script.
Source file format: plain text, one username per line.
@itsmingjie
itsmingjie / InsertionSort.java
Created April 4, 2018 02:50
Insertion Sort
public class InsertionSort {
public static void sort(int[] array){
int nextElement;
//examine one element at a time
//sorts subsets of elements.
//sorts the first 2, then the first 3, then the first 4....
@itsmingjie
itsmingjie / ball.pde
Last active May 7, 2018 23:50
Processing Agar extended game
import java.util.*;
Random rand = new Random();
/*
* Variable Initialization
* We used universal variables here to
* avoid the confusion of constantly
* changing parameters.
*/
int energyCount = 0, frames = 0, pScore = 0, eScore = 0, blackUntil = ‐1,
emergency = 5, bgR = 201, bgG = 214, bgB = 234;

Keybase proof

I hereby claim:

  • I am itsmingjie on github.
  • I am mingjie (https://keybase.io/mingjie) on keybase.
  • I have a public key whose fingerprint is 76D3 091D CBDD FA1F E1BD 4C26 2E4F 3FAA 6AFA 312D

To claim this, I am signing this object:

@itsmingjie
itsmingjie / siteTitleEasterEgg.js
Last active May 7, 2018 23:47
Change title bar on unfocus
//Easter Egg
var originaltitle = document.title;
var blurcount = 0;
window.onblur = function() {
if (blurcount == 0)
document.title = "¬_¬ Hey!";
else if (blurcount == 1)
document.title = "°Д° Come back!";
else if (blurcount == 2)
document.title = "。゜(`Д´)!!!゜。";
@itsmingjie
itsmingjie / Davistosis.java
Last active May 7, 2018 23:49
Davistosis Text-based Simple Java Game
/*
* This game made written for the excellent Dictator Davis by a pleb :-)
* BTW click the "raw" button on top left to get the naked code if you haven't already
* Comment below if anything is wrong!
* Enjoy
* Update 12/15/2016 Rewrote dying algorithm, fixed logical error.
*/
import java.util.*;
public class DavisCells {