Skip to content

Instantly share code, notes, and snippets.

View weatheredwatcher's full-sized avatar
:octocat:
Working from home

David Duggins weatheredwatcher

:octocat:
Working from home
View GitHub Profile
@weatheredwatcher
weatheredwatcher / Rakefile
Created April 2, 2021 04:21
Rakefile that I use to manage my resume. Can convert to pdf, HTML or Word doc.
task :default => :pdf
task :pdf => %W[resume-duggins.pdf]
%W[resume.md].each do |md_file|
pdf_file = File.basename(md_file, ".md") + "-duggins.pdf"
file pdf_file => md_file do
sh "pandoc #{md_file} -s -o #{pdf_file}"
end
end
<?php
namespace App\Command;
use App\Entity\Blog as EntityBlog;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Mni\FrontYAML\Parser;
@weatheredwatcher
weatheredwatcher / safari-pwgen.sh
Last active June 21, 2019 05:10
First pass at a Safari style password Generator
#! /bin/zsh
if ((! $+commands[pwgen] ));
then
echo "fail"
fi
i=0
while [ $i -lt 4 ]
do
@weatheredwatcher
weatheredwatcher / rm-apps.rb
Last active October 4, 2017 18:50
Quick little Ruby app to remove app from Heroku that are in a list.
file='heroku-apps-delete'
File.readlines(file).each do |app|
app=app.strip
system "heroku apps:delete #{app} --confirm #{app}"
end
import os
import sys
import argparse
import wget
import tarfile
if not os.geteuid() == 0:
sys.exit("\nMust be run by root\n")
def main(argv):
@weatheredwatcher
weatheredwatcher / vhost_writer.py
Last active November 15, 2023 16:16
A python script for creating vhost files
#!/usr/bin/python
import sys, getopt
def main(argv):
server = ''
path = ''
try:
opts, args = getopt.getopt(argv, "hs:p:", ["server=", "path="] )
@weatheredwatcher
weatheredwatcher / beerme.rb
Created December 5, 2013 04:09
This is a ruby snippet I use in a TextMate Bundle for Hipster Ipsum
#!/usr/bin/ruby
require 'open-uri'
require 'json'
url = 'http://hipsterjesus.com/api?paras=1'
buffer = open(url, "UserAgent" => "Ruby-Wget").read
# convert JSON data into a hash
@weatheredwatcher
weatheredwatcher / bat_test.sh
Created December 1, 2013 23:15
I found this script on the i3 forums and thought that I'd share it from here. It's a cool little script that checks for battery strength and warns you via the nagbar if your battery is running low. Helpful if you run the i3 status bar on the bottom and don't always notice if the battery is low!!
! /bin/bash
SLEEP_TIME=5 # Default time between checks.
SAFE_PERCENT=30 # Still safe at this level.
DANGER_PERCENT=15 # Warn when battery at this level.
CRITICAL_PERCENT=5 # Hibernate when battery at this level.
NAGBAR_PID=0
export DISPLAY=:0.0
@weatheredwatcher
weatheredwatcher / lithifyme.sh
Created September 19, 2013 20:15
Here is a basic shell script to create a new project based on lithium. Download then type: `sudo mv lithifyme.sh /usr/local/bin/lithifyme` or place it somewhere in your PATH so that you can execute it globally.
#!/bin/bash
# Lithifyme script.
# Creates a new project based on lithium.
# @Author David Duggins [weatheredwatcher@gmail.com]
# Released under the GPLv3
if [ ! -d "$1" ]; then
git clone git://github.com/UnionOfRAD/framework.git $1
echo "initializing submodules"
cd $1
@weatheredwatcher
weatheredwatcher / zf..sh
Created February 26, 2013 18:44
a really basic shell script to initiate a Zend Framework 2 Skeleton Application
#!/bin/sh
#
if [ -n "$1" ];
then
git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive $1
else
echo "no project given"