Skip to content

Instantly share code, notes, and snippets.

View farhansolodev's full-sized avatar

Farhan Alvi farhansolodev

View GitHub Profile
@farhansolodev
farhansolodev / golangci-lint-alias.sh
Created April 25, 2023 01:00
Prevent Go from compiling if golangci-lint issues persist by using this alias
alias go='go_with_lint'
function go_with_lint() {
local args=("$@")
local lint_cmd=("golangci-lint run .")
# Check if "run" or "build" command is being used
if [[ ${args[0]} == "run" || ${args[0]} == "build" ]]; then
# If a file or directory argument is provided, add it to the lint command
if [[ ${#args[@]} -gt 1 ]]; then
local file_or_dir="${args[1]}"
@farhansolodev
farhansolodev / drawChallenge.java
Last active November 4, 2019 10:03
Dev-Fest-Quiz
/* Run this code using an IDE that supports Java development*/
import java.util.Date; // to allow our tasks to run at the current time
import java.util.Timer; // contains the method which will allow a task to run at specific intervals
import java.util.TimerTask; //contains an abstract inherited run() method
public class drawChallenge {
static Timer timer = new Timer();
static int i = 0;
public static void main(String args[]) {