Skip to content

Instantly share code, notes, and snippets.

View pront's full-sized avatar

Pavlos Rontidis pront

View GitHub Profile
@pront
pront / pre-push.sh
Created June 10, 2025 13:25
pre push
#!/bin/bash
# Color codes
GREEN='\033[1;32m'
RED='\033[1;31m'
CYAN='\033[1;36m'
NC='\033[0m' # No color
# Get the current branch name
current_branch=$(git rev-parse --abbrev-ref HEAD)
@pront
pront / terminal.txt
Created May 14, 2025 16:21
rustc panic
11.36 Compiling vector v0.47.0 (/vector)
18.80 error: internal compiler error: encountered incremental compilation error with type_of(vector[a71f]::internal_events::batch::{impl#0}::emit::{constant#0})
18.80 |
18.80 = help: This is a known issue with the compiler. Run `cargo clean -p vector` or `cargo clean` to allow your project to compile
18.80 = note: Please follow the instructions below to create a bug report with the provided information
18.80 = note: See <https://github.com/rust-lang/rust/issues/84970> for more information
18.80
18.80
18.80 thread 'rustc' panicked at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/compiler/rustc_query_system/src/query/plumbing.rs:731:9:
18.80 Found unstable fingerprints for type_of(vector[a71f]::internal_events::batch::{impl#0}::emit::{constant#0}): EarlyBinder { value: {type error}, .. }
@pront
pront / repeat.sh
Created August 15, 2024 18:29
repeat command
#!/bin/bash
# Function to repeat a command for a certain duration
repeat_command() {
local command="$1"
local timeout="$2"
local end_time=$((SECONDS + timeout))
while [ $SECONDS -lt $end_time ]; do
eval "$command"
@pront
pront / sol.py
Created March 1, 2022 14:16
find graph bridges
class Solution:
rank = {}
graph = defaultdict(list)
conn_dict = {}
def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:
self.formGraph(n, connections)
self.dfs(0, 0)
@pront
pront / count_bt_nodes.cpp
Created April 18, 2020 18:00
count nodes in complete BT
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
@pront
pront / task_scheduler.cpp
Created April 18, 2020 17:55
task_scheduler_lc
class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
vector<int> freqs(26);
for (char c : tasks) {
freqs[c - 'A']++;
}
// max heap
priority_queue<int> pq;
@pront
pront / numSimilarGroups.cpp
Last active April 18, 2020 17:56
839. Similar String Groups
class Solution {
bool isSimilar(const string& a, const string& b) {
if (a.size() != b.size()) return false;
int count = 0;
for (int i = 0; i < a.size(); ++i) {
if (a[i] != b[i]) {
count++;
}
if (count > 2) return false;