Skip to content

Instantly share code, notes, and snippets.

View danaketh's full-sized avatar
🔥
Software firefighter

Daniel Tlach danaketh

🔥
Software firefighter
View GitHub Profile
@danaketh
danaketh / encrypt
Created December 6, 2015 20:37
Simple bash script I've made to make the Let's Encrypt faster to use...
#!/bin/bash
cmd="./letsencrypt-auto certonly --webroot -w"
if [ ! -z $1 ]
then
# CHANGE THIS!
source /path/to/configs/$1
cmd="$cmd $webroot"
for d in "${domains[@]}"
@danaketh
danaketh / .bashrc
Last active August 29, 2015 14:06
Nasty Bash alternative to https://github.com/sindresorhus/is-up
is-up() {
is_up_url="http://isitup.org/$1.json"
is_up_json=$(curl -s ${is_up_url})
is_up_status=$(expr "${is_up_json}" : '.*"status_code": \([0-9]\)')
if [ ${is_up_status} -eq 1 ];
then
echo -e "\e[32m✓\e[0m \e[37m$1\e[0m \e[32mis up\e[0m"
else
echo -e "\e[31m×\e[0m \e[37m$1\e[0m \e[31mis down\e[0m"
@danaketh
danaketh / TwigActiveForm
Created January 11, 2014 00:38
Just a basic Twig extension to support Yii ActiveForm
namespace danaketh/twig/ext;
use Yii;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
class TwigActiveForm extends \Twig_Extension
{
/**
* {@inheritdoc}