Skip to content

Instantly share code, notes, and snippets.

Phil Tysoe igniteflow

Block or report user

Report or block igniteflow

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
igniteflow /
Created Oct 8, 2018
Download all images from a Slack channel
import datetime
import requests
import os.path
TOKEN = 'xxxx-xxxx'
TARGET_DIR = './images/'
igniteflow /
Last active Apr 18, 2018
Google Drive: fix dotfile renaming

Google Drive replaces the leading dot in dot-filenames with an underscore. To undo this after downloading the files as a zip run

  # replaces leading underscores with dots
  rename -n 's/^_/./g' *  # first check
  rename 's/^_/./g' *  # now execute

After downloading the files be sure to set the correct permissions

igniteflow / .gitautouser
Created Feb 13, 2018
Git auto user. Switch git user/email based on active directory
View .gitautouser
#!/usr/bin/env python
Checks and sets git username and email based on dir root matching
1. Add the following to ~/.bashrc
function cd {
builtin cd "$@"
if [ -d ".git" ] ; then
igniteflow /
Last active May 13, 2018
Creating a command-line app with Python
  1. Create a
  #!/usr/bin/env python

  from distutils.core import setup

      name='My Thing',
# pull changes from a single file inside a commit (useful when hotpatching)
git diff ..<hash> -- <filename> | git apply
# view changes in a file historically
git diff 'HEAD@{3 weeks ago}'..HEAD -- foo/
# view commits with patches in this branch only (assuming it was branched from master and is up-to-date)
# useful when reviewing tickets
git log master.. --patch --reverse

Linux Commands


traceroute - print the route packets take to network host

ifconfig - interface configurator. view ip address and mac address

ping - (Packet INternet Groper) test connectivity between two nodes

igniteflow /
Created Nov 7, 2016
Debugging connection issues

nmap -p http,git

igniteflow /
Created Oct 3, 2016
How to mock an object property in Python
import mock
with mock.patch('', new_callable=mock.PropertyMock) as mock_my_property:
mock_my_property.return_value = 'my value'
print out all the emojis to spam your friends Slack clients
import requests
api_token = 'your-api-token'
text = ' '.join([':{}:'.format(e) for e in requests.get('{}'.format(token)).json()['emoji'].keys()])
igniteflow /
Created May 19, 2016
Python Coverage XML file parser in Coffeescript
fs = require 'fs',
xml2js = require 'xml2js'
coverage =
modules: []
filename = 'coverage.xml'
parser = new xml2js.Parser()
fs.readFile __dirname + '/' + filename, (err, data) ->
You can’t perform that action at this time.