Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Decoding the world, one line at a time

Andrés Bretón bretonics

:octocat:
Decoding the world, one line at a time
View GitHub Profile
@bretonics
bretonics / Launcher
Created May 22, 2015
Mac Apps launcher- Launch all user essential apps at once
View Launcher
-- Launch all your desired apps at once, with a single call.
-- Works wonderful right after startup/reboot without compromising boot time
set appsFolder to "/Applications"
set Apps to {"Mail", "Google Drive", "MenuMate", "Due", "PopClip", "Window Tidy", "Yoink",
"Trickster", "DropZone", "Mint QuickView", "unDock", "Visits", "CalendarFree", "Degrees"} --Change/add desired apps here
repeat with theItem in Apps
launch application theItem
end repeat
@bretonics
bretonics / progress-bar.sh
Created Nov 28, 2017 — forked from F1LT3R/progress-bar.sh
Bash Progress Bar
View progress-bar.sh
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
progressBarWidth=20
# Function to draw progress bar
progressBar () {
# Calculate number of fill/empty slots in the bar
@bretonics
bretonics / shiny_references.md
Last active Mar 20, 2018
Shiny Framework Function Reference Sheet
View shiny_references.md

Shiny Reference Sheet

A web application framework for R quick function reference sheet.

Input

Function Creates
actionButton() Action button element
submitButton() Submit button element
View snippets.cson
# -------------------------------------------------------------------------------
# GENERAL
'.source':
# Main Description Header
'Main Header':
'prefix': 'header'
'body': """
# ================================================================================
#
@bretonics
bretonics / template.qsub
Last active Aug 2, 2018
Template file for Sun Grid Engine (SGE) job submissions
View template.qsub
#!/bin/bash -l
# template.qsub - Template file for Sun Grid Engine (SGE) job submissions
# Andrés Bretón, http://andresbreton.com
# Template from https://gist.github.com/bretonics/1dc5d0926aefa7787ebf48a0bad5316b
#-------------------------------------------------------------------------------
# ENVIRONMENTAL VARIABLES AVAILABLE
@bretonics
bretonics / macOS
Last active Aug 2, 2018
macOS Tips and Tricks
View macOS
# Remove Dock Delay for Auto-Hide & Auto-Show
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
# Reset Dock Hide/Show Delay defaults
defaults delete com.apple.Dock autohide-delay && killall Dock
# Reduce autohide Dock animation
defaults write com.apple.dock autohide-time-modifier -float 0.25; killall Dock
# Reset autohide Dock animation defaults
@bretonics
bretonics / disk-usage-alert.cron
Created Feb 22, 2019
Available disk usage alert setup to run weekly on crontab
View disk-usage-alert.cron
#!/bin/bash
# /etc/cron.weekly/
LIMIT="85"
MAILTO=""
SUBJECT="Disk Usage Alert!"
BODY="WARNING! $(hostname) disk space is currently at ${USED}% capacity."
@bretonics
bretonics / add-sftp-user
Created Feb 25, 2019
Automate adding new SFTP chrooted accounts
View add-sftp-user
#!/usr/bin/env bash
# Automate adding new SFTP accounts (chrooted)
# --------------------------------------------------------------------------------
#
if [ $# == 0 ]; then
echo "Usage: add-sftp-user EMAILS "
echo "Automates adding a SFTP user account, delagating all tasks and sending confirmation email."
else
View .bash_functions
# .bash_functions - User bash functions
# Template from https://gist.github.com/bretonics/894d8c2d1d4813c36b7d36e9a97aedd6
#-------------------------------------------------------------------------------
# SYSTEM
mkcd() {
mkdir $1; cd $1
}
@bretonics
bretonics / crontab
Last active Nov 4, 2020
Crontab template
View crontab
# Crontab - Crontab template to automate virtual world
# Template from https://gist.github.com/bretonics/9a48a3b9ef32d93d15f45c3f007550b4
# Andrés Bretón ~ http://andresbreton.com, dev@andresbreton.com
# ==============================================================================
# MIN(0-59) HOUR(0-23) DOM(1-31) M(1-12) DOW(0-6) CMD
# |__________|_________|_______|________|______ |__MINUTE of
# |_________|_______|________|______ |__HOUR of