Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
bogdanRada / dom-ready.js
Created January 31, 2020 15:33 — forked from carldanley/dom-ready.js
Simple DOM ready() detection without jQuery
var DOM = new function(){
var IS_READY = false;
var CALLBACKS = [];
var SELF = this;
SELF.ready = function( callback ){
//check to see if we're already finished
if( IS_READY === true && typeof callback === 'function' ){
callback();
return;
@bogdanRada
bogdanRada / Dockerfile
Created July 31, 2019 07:08 — forked from fishi0x01/Dockerfile
Jenkins Pipeline as Code. Code for blog post http://fishi.devtail.io/weblog/E/
FROM tomcat:8.0.38
# Place the code version inside the webapps directory
ARG PACKAGE_VERSION
RUN echo "${PACKAGE_VERSION}" >> /usr/local/tomcat/webapps/version.txt
COPY project.war /usr/local/tomcat/webapps/project.war
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
stage 'Test'
// Split the previously executed tests into 10 jobs
def splits = splitTests parallelism: [$class: 'CountDrivenParallelism', size: 10], generateInclusions: true
def branches = [:]
// Prepare each job
for (int i = 0; i < splits.size(); i++) {
def split = splits[i]
branches["split${i}"] = {
// The job should allocate a new jenkins slave
node('dockerSlave') {
@bogdanRada
bogdanRada / linux-cheatsheet.rtf
Created July 31, 2019 06:05 — forked from vadirajks/linux-cheatsheet.rtf
Comprehensive Linux Cheatsheet
```
____ _ _
/ ___|___ _ __ ___ _ __ _ __ ___| |__ ___ _ __ ___(_)_ _____
| | / _ \| '_ ` _ \| '_ \| '__/ _ \ '_ \ / _ \ '_ \/ __| \ \ / / _ \
| |__| (_) | | | | | | |_) | | | __/ | | | __/ | | \__ \ |\ V / __/
\____\___/|_| |_| |_| .__/|_| \___|_| |_|\___|_| |_|___/_| \_/ \___|
|_|
_ _ ____ _ _ _ _
| | (_)_ __ _ ___ __ / ___| |__ ___ __ _| |_ ___| |__ ___ ___| |_
| | | | '_ \| | | \ \/ / | | | '_ \ / _ \/ _` | __/ __| '_ \ / _ \/ _ \ __|
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias edit='idea' # edit: Opens any file in sublime editor
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias o=f
alias lista="list_aliases"
alias showa="list_aliases"
alias qfind="find . -name " # qfind: Quickly search for file
alias memHogsTop='top -l 1 -o rsize | head -20'
alias memHogsPs='ps wwaxm -o pid,stat,vsize,rss,time,command | head -10'
alias cpu_hogs='ps wwaxr -o pid,stat,%cpu,time,command | head -10'
@bogdanRada
bogdanRada / bash_profile
Created July 31, 2019 06:02 — forked from marweck/bash_profile
My .bash_profile or .bashrc
# bash_profile
#############################################
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
export PS1="$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(__git_ps1)$BLACK ] "
export CLICOLOR=1
@bogdanRada
bogdanRada / .bash_profile
Created July 31, 2019 06:02 — forked from lucaswhitman/.bash_profile
Bash aliases
#colorized man pages
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
@bogdanRada
bogdanRada / proxy.rb
Created June 24, 2019 09:58 — forked from tomlea/proxy.rb
Rack Middleware to proxy requests to a remote server. This is usefull for proxying AJAX request to remote services.
require "net/http"
require "enumerator"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
@bogdanRada
bogdanRada / pre-commit
Created April 30, 2019 07:56 — forked from aaronhoffman/pre-commit
git hooks - prevent commit to local master branch and prevent push to remote master branch
#!/bin/sh
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
fi
exit 0