Skip to content

Instantly share code, notes, and snippets.

View KevinGimbel's full-sized avatar
🤳
GitHub Stories when?

Kevin Gimbel KevinGimbel

🤳
GitHub Stories when?
View GitHub Profile
@KevinGimbel
KevinGimbel / raddit.service
Created February 19, 2019 10:00 — forked from Artemmkin/raddit.service
Raddit unit file
[Unit]
Description=Raddit application
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/raddit
ExecStart=/bin/bash -lc 'puma'
Restart=always
Started building sites ...
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "/"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "/"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags/frontend"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags/frontend"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags/javascript"
ERROR 2017/01/13 12:15:21 Failed to normalize URL string. Returning in = "tags/javascript"
@KevinGimbel
KevinGimbel / 01_ws.sh
Last active April 15, 2016 11:06
switch to workspace or sub directory if available
# Switch to workspace or directly into a workspace directory if any is found
function ws() {
# $1 is the target directory
target_dir=$1
# We start searching from the workspace dir, you need to adjust this when
# adding the script to your own .bash_profile or .bashrc
cd ~/workspace
# -maxdepth is the max directories to go "down"
# head -n1 gives back the first result
workspace_path=$(find -maxdepth 3 -type d -name "*$target_dir*" | head -n1)
@KevinGimbel
KevinGimbel / bash_profile.sh
Created November 17, 2015 09:48 — forked from mislav/bash_profile.sh
Simple bash prompt that shows current git branch (if any) and colors the dollar sign in red if the last command exited with a nonzero status.
_git_prompt() {
local ref="$(command git symbolic-ref -q HEAD 2>/dev/null)"
if [ -n "$ref" ]; then
echo " (${ref#refs/heads/})"
fi
}
_failed_status() {
[ "$PIPESTATUS" -ne 0 ] && printf "$"
}
@KevinGimbel
KevinGimbel / convert_posts
Created November 7, 2015 22:30
A bash script to convert Markdown files from Jekyll-like Format to Metalsmith Format.
######################################################################
# convert_posts #
# #
# A bash script to convert Jekyll-style files into Handlebar files. #
# #
# Reads the current directory, searches for all *.md files and #
# then replaces the first line with #
# --- #
# date: $DATE #
# #
@KevinGimbel
KevinGimbel / vhost
Last active August 29, 2015 14:20 — forked from gistwebdev/vhost
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
@KevinGimbel
KevinGimbel / links
Last active August 29, 2015 14:15
Useful Links.
<?php # -*- coding: utf-8 -*-
/**
* Create a nav menu with very basic markup.
*
* @author Thomas Scholz http://toscho.de
* @version 1.0
*/
class T5_Nav_Menu_Walker_Simple extends Walker_Nav_Menu
{
/**
@KevinGimbel
KevinGimbel / alert
Last active August 29, 2015 14:05
This part placed in ~/.bashrc makes the Shell on Ubuntu capable of sending System Notifications.
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//; s/[;&|]\s*alert$//'\'')"'
#
# Example Usage:
# sudo apt-get update; alert
#
# will sent a notification when the update is finished.