Skip to content

Instantly share code, notes, and snippets.

View amarlearning's full-sized avatar
🏎️

Amar Prakash Pandey amarlearning

🏎️
View GitHub Profile
@mbiemann
mbiemann / colima-docker-apple-silicon.md
Last active March 1, 2025 22:33
Using colima and Docker Engine on Apple Silicon (M1 Chip)

Using colima and Docker Engine on Apple Silicon (M1 Chip)

This tutorial uses Homebrew to install colima and Docker.

It was tested on Apple MacBook Pro (13-inch, M1, 2020) 8G and macOS Monterey version 12.1 (21C52).

Uninstall any Docker version

Make sure you have fully uninstall any versions of Docker. You can check using:

@mattiasholmqvist
mattiasholmqvist / Jenkinsfile.groovy
Created May 24, 2017 07:32
Example Jenkinsfile for Kubernetes-based CI docker builds
podTemplate(label: 'builder',
containers: [
containerTemplate(name: 'jnlp', image: 'larribas/jenkins-jnlp-slave-with-ssh:1.0.0', args: '${computer.jnlpmac} ${computer.name}'),
containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'kubectl', image: 'ceroic/kubectl', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat')
],
volumes: [
hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'),
secretVolume(secretName: 'maven-settings', mountPath: '/root/.m2'),
@JBirdVegas
JBirdVegas / ThreadPoolWorkHandler.java
Created November 15, 2016 22:01
Example thread pool manager in java
package com.jbirdvegas.testing;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class ThreadPoolWorkHandler {
private static final int QUEUE_SIZE = 50;
@seven1m
seven1m / init.vim
Last active January 18, 2025 07:49
my vim/neovim config in < 100 LOC
syntax on " enable syntax highlighting
set background=dark " we like it dark!
try | colorscheme gruvbox | catch | endtry " use this awesome theme if possible
highlight Pmenu ctermbg=black guibg=black | " fix popup color so it's easier to read
filetype plugin on " load plugins based on file type
filetype indent on " load indent settings based on file type
set shiftwidth=2 " number of spaces to use for indenting
set softtabstop=2 " number of spaces to use when inserting a tab
set tabstop=2 " show tabs as 2 spaces
set expandtab " convert tabs into spaces
@JohannesHoppe
JohannesHoppe / settings.json
Created May 18, 2016 12:04
VSCode: proxy settings
// VSCode: Place your settings in this file to overwrite the default settings
{
"http.proxy": "http://user:pass@proxy.com:8080",
"https.proxy": "http://user:pass@proxy.com:8080",
"http.proxyStrictSSL": false
}
@vasanthk
vasanthk / System Design.md
Last active September 21, 2025 18:35
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@patik
patik / how-to-squash-commits-in-git.md
Last active July 24, 2025 08:48
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@dmichael
dmichael / gist:1362424
Created November 13, 2011 18:11
Sigmoid Gradient
function g = sigmoid(z)
g = sigmoid = 1.0 ./ (1.0 + exp(-z));
end
function g = sigmoidGradient(z)
g = sigmoid(z) .* (1 - sigmoid(z));
end