Skip to content

Instantly share code, notes, and snippets.

View amarlearning's full-sized avatar
:shipit:

Amar Prakash Pandey amarlearning

:shipit:
View GitHub Profile
@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 March 17, 2023 21:58
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 May 16, 2024 20:21
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?
@amarlearning
amarlearning / Desktop Notifications Using Javascript.markdown
Created January 18, 2016 19:21
Desktop Notifications Using Javascript
@amarlearning
amarlearning / Slide out menu using css & Jquery.md
Last active April 5, 2017 13:14
Slide out menu using css & Jquery
@patik
patik / how-to-squash-commits-in-git.md
Last active October 17, 2023 02:19
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