Skip to content

Instantly share code, notes, and snippets.

@m-radzikowski
m-radzikowski / script-template.sh
Last active May 12, 2021
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
View script-template.sh
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@ayyybe
ayyybe / ccdl.command
Last active May 14, 2021
Adobe Offline Package Generator v0.1.2 (macOS only)
View ccdl.command
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
View things-i-believe.md

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active Apr 1, 2021
Multiple MySQL versions on MacOS with Homebrew
View HOWTO.md

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@CansecoDev
CansecoDev / vmangos.sh
Created Nov 22, 2018
VMaNGOS deploy script for Ubuntu 16.04
View vmangos.sh
#!/bin/bash
#============================================================================
#title :vmangos.sh
#description :VMaNGOS deploy script for Ubuntu 16.04
#author :canseco.me
#date :20181122
#version :0.8.1
#============================================================================
## Utilities
@pecigonzalo
pecigonzalo / delete_all_object_versions.sh
Last active May 11, 2021 — forked from weavenet/delete_all_object_versions.sh
Delete all versions (except latest) of all files in s3 versioned bucket using AWS CLI and jq.
View delete_all_object_versions.sh
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions | .[] | select(.IsLatest | not)'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@pawelztef
pawelztef / _flash.html.erb
Last active Oct 5, 2020
rails flash messages with bootstrap 4
View _flash.html.erb
<div class="container">
<% flash.each do |type, msg| %>
<div class="alert <%= bootstrap_class_for_flash(type) %> alert-dismissable fade show">
<%= msg %>
<button class="close" data-dismiss="alert">x</button>
</div>
<% end %>
</div>
View vagrant-update-all-boxes.sh
#!/bin/bash
OLDIFS=$IFS
export IFS=$'\n'
# Find all boxes which have updates
AVAILABLE_UPDATES=$(vagrant box outdated --global | grep outdated | tr -d "*'" | cut -d ' ' -f 2 2>/dev/null)
if [[ ${#AVAILABLE_UPDATES[@]} -ne 0 ]]; then
@chezou
chezou / Gemfile
Last active May 11, 2019
Example code of ruby with Amazon Polly
View Gemfile
source 'https://rubygems.org'
gem 'nokogiri', '~>1.6'
gem 'aws-sdk', '~> 2'
@MyklClason
MyklClason / Gemfile.rb
Last active Jun 5, 2019
Search/Sort/Paginate with Ransack and Kaminari
View Gemfile.rb
...
gem 'kaminari'
gem 'ransack'
..