Skip to content

Instantly share code, notes, and snippets.

using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@sreyemnayr
sreyemnayr / colorterm.sh
Created March 21, 2019 15:43
Auto-color terminal background to avoid ssh production oopsiedaisies
#!/bin/bash
#
# Based almost entirely on Bryan Gilbert's solution:
# http://bryangilbert.com/post/etc/term/dynamic-ssh-terminal-background-colors/
#
# Sets terminal screen to color based on keywords or hex code (no #, for some reason that breaks)
#
# For SSH magic, add following to ~/.zshrc:
#
: <<'END_COMMENT'
@rueycheng
rueycheng / GNU-Make.md
Last active October 25, 2025 15:47
GNU Make cheatsheet
public class SimpleRateLimiter {
private Semaphore semaphore;
private int maxPermits;
private TimeUnit timePeriod;
private ScheduledExecutorService scheduler;
public static SimpleRateLimiter create(int permits, TimeUnit timePeriod) {
SimpleRateLimiter limiter = new SimpleRateLimiter(permits, timePeriod);
limiter.schedulePermitReplenishment();
return limiter;
@madan712
madan712 / PingIP.java
Last active December 19, 2023 06:57
Java program to ping an IP address
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class PingIP {
public static void runSystemCommand(String command) {
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader inputStream = new BufferedReader(
@jasonrudolph
jasonrudolph / about.md
Last active August 19, 2025 03:09
Programming Achievements: How to Level Up as a Developer