This file contains hidden or 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
| // ==UserScript== | |
| // @name Save My Solution | |
| // @namespace https://gist.github.com/Roytangrb/7df5bd7c0321debb9df8e539662b08ea | |
| // @version 2.2 | |
| // @updateURL https://gist.githubusercontent.com/Roytangrb/7df5bd7c0321debb9df8e539662b08ea/raw/save-my-solution.js | |
| // @downloadURL https://gist.githubusercontent.com/Roytangrb/7df5bd7c0321debb9df8e539662b08ea/raw/save-my-solution.js | |
| // @description Save Leetcode question No., name, URL and current code in editor to a download file | |
| // @author Roy Tang | |
| // @match https://leetcode.com/problems/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com |
This file contains hidden or 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
| setopt prompt_subst | |
| # Remember to chmod +x for these scripts | |
| alias notifyme='~/notifyme.scpt' | |
| alias frontapp='~/frontapp.scpt' | |
| # Set Applcation of the current prompt | |
| export APP_OF_PS1=$(frontapp) | |
| # Adapted from: https://frantic.im/notify-on-completion/ |
This file contains hidden or 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
| # prompt | |
| # include important env variable in prompt | |
| PROMPT='$ENVIRONMENT_NAME %B%F{240}%2~%f %# ' | |
| # custom zsh config | |
| # UP and DOWN startsWith search | |
| autoload -U history-search-end | |
| zle -N history-beginning-search-backward-end history-search-end | |
| zle -N history-beginning-search-forward-end history-search-end | |
| bindkey "^[[A" history-beginning-search-backward-end |
This file contains hidden or 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
| /** | |
| * Hex game implementation (use g++ -std=c++11 hexgame.cpp) | |
| * By RT | |
| * 12th Dec, 2020 | |
| */ | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <string> | |
| #include <tuple> |
This file contains hidden or 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
| // Implement Dijsktra's algorithm, calc avg shortest path length & MST | |
| // By RT | |
| // 9th Dec, 2020 | |
| #include <iostream> | |
| #include <chrono> | |
| #include <random> | |
| #include <vector> | |
| #include <iterator> | |
| #include <fstream> |
This file contains hidden or 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
| /* | |
| * Create BST from file read | |
| * By RT | |
| * 24 Nov, 2020 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef struct node { |
This file contains hidden or 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
| /* | |
| * Read int from file and calc avg | |
| * By RT | |
| * 23 Nov, 2020 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int argc, char *argv[]){ |
This file contains hidden or 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
| /* | |
| * Remove duplicate from a sorted doubly linked list | |
| * By RT | |
| * 22 Nov, 2020 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> |
This file contains hidden or 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
| /* | |
| * Bubble sort a list | |
| * By RT | |
| * 22 Nov, 2020 | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> |
This file contains hidden or 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
| /* | |
| * Card Struct | |
| * By RT | |
| * 21 Nov, 2020 | |
| */ | |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <stdlib.h> |
NewerOlder