Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Nagle rnagle

View GitHub Profile
@rnagle
rnagle / Jenkinsfile
Created Feb 8, 2017
Jenkinsfile outline w/ essentials
View Jenkinsfile
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 Jun 3, 2016
WordPress.org plugin release script
View release.sh
#!/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
View create-ec2-snapshot.sh
#!/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 Apr 14, 2016
Weather for your shell
View weather.sh
# Ex. weather "Chicago, IL"
function weather() {
local location="$1";
curl "http://wttr.in/$location";
}
View gist:e4907b1e3a8b653191e2
import sys
from tarbell.settings import Settings
sys.path.append(Settings().config.get('projects_path'))
@rnagle
rnagle / gitconf.sh
Created Nov 25, 2015
Get path to the git conf file for the current repository
View gitconf.sh
#!/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 Nov 10, 2015
Import Newslynx users from CSV
View import_newslynx_users.py
import csv
import re
from unicodedata import normalize
from newslynx.client import API
_punct_re = re.compile(r'[\t !"#$%&\'()*\-/<=>?@\[\\\]^_`{|},.]+')
def main():
View keybase.md

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 Jun 25, 2015
Rainbows for your body copy
View rainbows.js
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 Apr 30, 2021
Default WordPress Database Table Create Statements
View wpdb_default_tables.sql
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 '',