Skip to content

Instantly share code, notes, and snippets.

View electron0zero's full-sized avatar
🎯
Focusing

Suraj Nath electron0zero

🎯
Focusing
View GitHub Profile
@electron0zero
electron0zero / arxiv2kindle.ipynb
Created March 1, 2018 21:29 — forked from bshillingford/arxiv2kindle.ipynb
arxiv2kindle: recompiles an arxiv paper for kindle-sized screens, and sends it to your wifi-enabled kindle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@electron0zero
electron0zero / deleteJenkinsJobs.groovy
Created February 28, 2018 10:33 — forked from nextrevision/deleteJenkinsJobs.groovy
Groovy script to delete all jenkins jobs that match a regex pattern
import jenkins.model.*
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /my_regex_here/
}
matchedJobs.each { job ->
println job.name
//job.delete()
}
@electron0zero
electron0zero / Jenkinsfile
Created February 28, 2018 10:32 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@electron0zero
electron0zero / hash_with_indifferent_access_benchmark.rb
Created February 28, 2018 06:03 — forked from tiagoamaro/hash_with_indifferent_access_benchmark.rb
ActiveSupport's HashWithIndifferentAccess access benchmark vs common Ruby Hash
#####################
# Ruby Version: 2.1.6
#####################
# gem 'activesupport', '=3.2.22'
# gem 'activesupport', '=4.2.5'
require 'active_support/all'
require 'benchmark/ips'
@electron0zero
electron0zero / Jenkinsfile
Created February 27, 2018 20:59 — forked from beatngu13/Jenkinsfile
Fancy notifications for Slack and HipChat in a Jenkins Pipeline
// Based on https://jenkins.io/blog/2016/07/18/pipline-notifications/.
def notifyMessengers(String buildStatus = 'STARTED') {
// Build status of null means successful.
buildStatus = buildStatus ?: 'SUCCESS'
// Replace encoded slashes.
def decodedJobName = env.JOB_NAME.replaceAll("%2F", "/")
def colorSlack
def colorHipchat
@electron0zero
electron0zero / gist:70d62f25c446ef5a3fbe7c0ec5583db7
Created February 27, 2018 18:57 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@electron0zero
electron0zero / JENKINS-28447.workaround.groovy
Created February 27, 2018 10:58 — forked from kad/JENKINS-28447.workaround.groovy
workaround for JENKINS-28447 in case of github trigger plugin.
// Reconfigure job to have Pipeline DSL configured inside job, instead of from scm.
// Put snippet below to pipeline text box
// Define additional job parameters:
// GITHUB_PROJECT: string, URL to your GitHub repository
// GITHUB_AUTH: string, credentials ID to use in case of private GitHub repository
node {
dir('pipeline_handover') {
checkout([$class: 'GitSCM',
branches: [[name: "origin-pull/$GITHUB_PR_NUMBER/$GITHUB_PR_COND_REF"]],
doGenerateSubmoduleConfigurations: false,
@electron0zero
electron0zero / install-google-fonts.sh
Created February 26, 2018 18:04 — forked from keeferrourke/install-google-fonts.sh
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell, ttf-ubuntu-font-family, git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
@electron0zero
electron0zero / Dockerfile
Created February 25, 2018 00:36 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@electron0zero
electron0zero / Dockerfile
Created February 24, 2018 18:28 — forked from alkrauss48/Dockerfile
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app