Skip to content

Instantly share code, notes, and snippets.

Phill Pafford phillpafford

Block or report user

Report or block phillpafford

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
felixrabe / Dockerfile
Last active Aug 29, 2015
Simple webserver in Bash for Raspberry Pi using Docker
View Dockerfile
FROM sdhibit/rpi-raspbian
RUN apt-get update && apt-get install -y netcat-openbsd
RUN echo 'HTTP/1.1 200 OK' >> www
RUN echo 'Content-Type: text/html' >> www
RUN echo >> www
RUN echo '<h1>Hello <i>world!</i></h1>' >> www
CMD ["/bin/bash", "-c", "while true ; do nc -l 9999 < www > /dev/null ; done"]
remmelt /
Last active Jun 25, 2019
Post an Atlassian Bamboo build result to Slack
Create a stage in your project, make it the last stage.
Make a task in the stage with this inline script:
#! /bin/bash
/some/path/ "${bamboo.planKey}" "${bamboo.buildPlanName}" "${bamboo.buildResultsUrl}"
DanHerbert /
Last active Oct 19, 2019
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.


This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

swarminglogic /
Last active Oct 20, 2019
watchfile - monitor file(s) and execute a command when files are changed
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
hschnegg / PostgreSQL test if text can be cast to numeric
Created Jan 28, 2014
PostgreSQL: Test if text can be cast to numeric
View PostgreSQL test if text can be cast to numeric
select (mytext ~ '^([0-9]+[.]?[0-9]*|[.][0-9]+)$');
bickart / tincheck.php
Created Aug 1, 2012
Example Code to access's webservice
View tincheck.php
* August 1, 2012
* Jeff Bickart
* Twitter: @bickart
* Blog:
* The following is a example of usage of the web-service to test the ValidateTinName
jordelver / gist:3139365
Created Jul 18, 2012
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)
View gist:3139365

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
ziadoz /
Last active Oct 9, 2019
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
cjus /
Created Jun 26, 2011
Extract a JSON value from a BASH script
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
json=`curl -s -X GET$1.json`
You can’t perform that action at this time.