Skip to content

Instantly share code, notes, and snippets.

View skwashd's full-sized avatar
👨‍💻
planning, coding, reviewing

Dave Hall skwashd

👨‍💻
planning, coding, reviewing
View GitHub Profile
@ericjsilva
ericjsilva / CBJenkins.xml
Created August 28, 2013 12:46
Sample MuleSoft flow using the Jenkins connector against CloudBees to get information about a job, and then execute the job. NOTE: Code will not execute the job due to the fact that CloudBees requires a POST request and the Jenkins connector issues a GET request.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:jenkins="http://www.mulesoft.org/schema/mule/jenkins" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/jenkins http://www.mulesoft.org/schema/mule/jen
@tserong
tserong / vote-analysis.rb
Last active December 22, 2015 19:39
Spit out the percentage of first preference votes a given political party got in the senate, by division.
#!/usr/bin/env ruby
#
# Go to http://vtr.aec.gov.au/SenateDownloadsMenu-17496-csv.htm and get
#
# * First Preferences by Division by Vote Type
# http://vtr.aec.gov.au/Downloads/SenateFirstPrefsByDivisionByVoteTypeDownload-17496.csv
#
# * Votes by Division
# http://vtr.aec.gov.au/Downloads/SenateVotesCountedByDivisionDownload-17496.csv
#
@skwashd
skwashd / pre-commit
Last active January 4, 2016 04:59
Git pre-commit hook for checking files with coder-review and php lint. This prevents developers committing broken PHP or code that doesn't comply with the Drupal coding standards.Add this file to .git/hooks/pre-commit in the root of your doc repo and make it executable (chmod +x .git/hooks/pre-commit).You must have the coder module in ~/.drush/T…
#!/bin/bash
#
# Git pre-commit hook for Drupal projects.
# Created by Dave Hall - http://davehall.com.au
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
set -e
@rteijeiro
rteijeiro / .vimrc
Last active June 21, 2016 19:30
Vim config for Drupal project development
" Allow Vim-only settings even if they break vi keybindings.
set nocompatible
" Load plugins with Pathogen
execute pathogen#infect()
execute pathogen#helptags()
" Enable filetype detection.
filetype off
filetype plugin indent on
@tedbow
tedbow / wgit-apply.sh
Created May 20, 2016 12:19
Apply a patch with saving it
path=${1}
if [ $1 ]
then
wget -q -O - $1 | git apply -
else
echo "please enter url"
exit
fi
@ModulesUnraveled
ModulesUnraveled / drushrc.php
Last active May 14, 2017 23:34
Useful Drush shell-aliases for Drupal 8 development.
<?php
/**
* These aliases (while working) are NO LONGER MAINTAINED.
*
* Development has moved to a full github repo here:
* https://github.com/ModulesUnraveled/Drush-Shell-Aliases
*
* I'm doing this to make it more easy to include them in your Drupal 8 projects.
@danny-englander
danny-englander / openshift-drupal-deploy
Last active June 24, 2017 04:18
OpenShift Origin Drupal Deploy Script
#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again. This script gets executed directly, so it could be python, php,
# ruby, etc.
# Bash help: http://www.panix.com/~elflord/unix/bash-tute.html
# For information about action hooks supported by OpenShift, consult the documentation:
# http://openshift.github.io/documentation/oo_user_guide.html#the-openshift-directory
@niels-nijens
niels-nijens / .travis.yml
Last active November 24, 2017 13:32
Running Apache2 and PHP-FPM in Travis CI container-based infrastructure
addons:
apt:
packages:
- apache2
- libapache2-mod-fastcgi
install:
- echo "Initializing Apache2 and PHP-FPM"
- cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
@thatsdone
thatsdone / pdaemon-sample.py
Last active August 14, 2018 05:27
A python-daemon 'runner.DaemonRunner' class extension (v0.1) and a sample.
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#!/usr/bin/python
import sys
import time
import logging
from daemon import runner
#
# An example daemon main logic application class.
# Just keep writing timestamps to a log file periodically.
#
/**The MIT License (MIT)
Copyright (c) 2016 by Daniel Eichhorn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: