Skip to content

Instantly share code, notes, and snippets.

View polaroidkidd's full-sized avatar
🤔

Daniel Einars polaroidkidd

🤔
  • ti&m AG
  • Zürich, Switzerland
View GitHub Profile
@polaroidkidd
polaroidkidd / cleanNodeInstall.sh
Last active June 27, 2024 13:39
Helper scripts for wiping yarn, npm & pnpm node_modules and reinstalling
# Function to delete node_modules directory, clean package
# manager's global cache and install dependencies based on lock file
# Usage: __nodeWipeInstall
function __nodeWipeInstall(){
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
BOLD=$(tput bold)
echo -e "${BOLD}${GREEN}*************** DELETING NODE_MODULES *******************${RESET}"
find . -name "node_modules" -type d -prune -print -exec rm -rf "{}" \;
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/dle/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
{
"folders": [],
"v": 1,
"name": "in28minutes-spring",
"requests": [
{
"headers": [],
"endpoint": "http://localhost:8080/users",
"method": "GET",
"auth": {
@polaroidkidd
polaroidkidd / test.js
Created September 14, 2022 11:52
Codility Demo JavaScript
'use strict';
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
/**
*
* @param {number[]} A
* @returns {number}
*/
function solution(A) {
{
"basics": {
"name": "Daniel L. Einars",
"label": "Senior Software Engineer",
"image": "./avatar.jpeg",
"email": "[email protected]",
"phone": "+41 79 640 60 84",
"summary": "My Summary Goes Here",
"location": {
"address": "Höflistrasse 10",
#!/usr/bin/env bash
set -e
BLUETOOTH_STATE=$(dbus-send --session --dest=org.blueman.Applet --print-reply=literal /org/blueman/applet org.blueman.Applet.GetBluetoothStatus | sed "s/^[[:space:]].*boolean //g")
if [ "${BLUETOOTH_STATE}" == "true" ]; then
dbus-send --session --dest=org.blueman.Applet --print-reply /org/blueman/applet org.blueman.Applet.SetBluetoothStatus boolean:false
else
dbus-send --session --dest=org.blueman.Applet --print-reply /org/blueman/applet org.blueman.Applet.SetBluetoothStatus boolean:true
fi
@polaroidkidd
polaroidkidd / pipeline.gdsl
Created April 25, 2019 07:06 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@polaroidkidd
polaroidkidd / nginx.conf
Created March 28, 2019 05:12
nginx.conf for reverse proxy configuration for dockerized reverse nginx proxy linking bitbucket server, jira & bamboo
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
@polaroidkidd
polaroidkidd / docker-compose.yml
Last active December 28, 2023 09:09
docker-compose.yml for Bitbucket Server, Jira & Bamboo behind reverse nginx proxy with cerbot container
version: '3.7'
services:
### BEGIN PROXY/CERTBOT/SITE/CICD###
nginx:
image: nginx:1.15.9-alpine
container_name: dle-nginx
restart: unless-stopped
volumes:
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf
@polaroidkidd
polaroidkidd / docker-compose.yml
Created March 26, 2019 08:24
Bamboo & Bitbucket in Docker-Compose
version: '3.7'
services:
nginx:
image: nginx:1.15.9-alpine
container_name: dle-nginx
# restart: unless-stopped
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt