Skip to content

Instantly share code, notes, and snippets.

View rnagle's full-sized avatar

Ryan Nagle rnagle

View GitHub Profile
@rnagle
rnagle / Jenkinsfile
Created February 8, 2017 15:33
Jenkinsfile outline w/ essentials
node {
currentBuild.result = 'SUCCESS'
try {
stage('Checkout') {
// Use this for "Pipeline script from SCM"
// checkout scm
// Use this for copy/paste pipeline script into jenkins
@rnagle
rnagle / release.sh
Last active June 3, 2016 20:09
WordPress.org plugin release script
#!/usr/bin/env bash
RELEASE_DIR=release;
SVN_PATH=$RELEASE_DIR/svn;
SVN_REPO="https://plugins.svn.wordpress.org/plugin-slug-goes-here/";
BLACKLIST=(
.\*
release.sh
mkdocs.yml
phpunit.xml
requirements.txt
@rnagle
rnagle / create-ec2-snapshot.sh
Created June 1, 2016 19:21
Create EC2 Snapshots
#!/bin/bash
source /home/newsapps/secrets/all_secrets.sh;
export AWS_ACCESS_KEY_ID=$SNAPSHOTS_AWS_ACCESS_KEY_ID;
export AWS_SECRET_ACCESS_KEY=$SNAPSHOTS_AWS_SECRET_ACCESS_KEY;
export PATH=$PATH:/usr/local/bin;
export NUMBER_OF_SNAPSHOTS_TO_KEEP=3;
export DATE_STR=`date +%y.%m.%d.%I`;
export INSTANCE_ID=`ec2metadata --instance-id`;
# Get the ID of the volume mounted as the root device on this instance
export VOLUME_ID=`/usr/local/bin/aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$INSTANCE_ID Name=attachment.device,Values=/dev/sda1 --query 'Volumes[*].{ID:VolumeId}' | grep ID | awk '{print $2}' | tr -d '"'`
@rnagle
rnagle / weather.sh
Created April 14, 2016 14:42
Weather for your shell
# Ex. weather "Chicago, IL"
function weather() {
local location="$1";
curl "http://wttr.in/$location";
}
import sys
from tarbell.settings import Settings
sys.path.append(Settings().config.get('projects_path'))
@rnagle
rnagle / gitconf.sh
Created November 25, 2015 16:12
Get path to the git conf file for the current repository
#!/bin/bash
function gitconf() {
if [[ -d .git ]]
then
echo ".git/config"
return 0;
fi
if [[ -f .git ]]
@rnagle
rnagle / import_newslynx_users.py
Last active November 10, 2015 14:13
Import Newslynx users from CSV
import csv
import re
from unicodedata import normalize
from newslynx.client import API
_punct_re = re.compile(r'[\t !"#$%&\'()*\-/<=>?@\[\\\]^_`{|},.]+')
def main():

Keybase proof

I hereby claim:

  • I am rnagle on github.
  • I am ryannagle (https://keybase.io/ryannagle) on keybase.
  • I have a public key whose fingerprint is 5C70 4795 68A0 FD2C 2260 DCB9 CEB0 34CE 7186 AB08

To claim this, I am signing this object:

@rnagle
rnagle / rainbows.js
Created June 25, 2015 15:20
Rainbows for your body copy
var rainbows = rainbows || {};
(function() {
var $ = jQuery;
rainbows.last_offset = 0;
rainbows.colors = [
'red', 'green', 'yellow', 'blue', 'orange',
'purple', 'pink', 'brown', 'black', 'gray', 'white'
@rnagle
rnagle / wpdb_default_tables.sql
Last active March 28, 2024 22:37
Default WordPress Database Table Create Statements
DROP TABLE IF EXISTS wp_users;
CREATE TABLE wp_users (
ID bigint(20) unsigned NOT NULL auto_increment,
user_login varchar(60) NOT NULL default '',
user_pass varchar(64) NOT NULL default '',
user_nicename varchar(50) NOT NULL default '',
user_email varchar(100) NOT NULL default '',
user_url varchar(100) NOT NULL default '',
user_registered datetime NOT NULL default '0000-00-00 00:00:00',
user_activation_key varchar(60) NOT NULL default '',