Skip to content

Instantly share code, notes, and snippets.

View bmcguirk's full-sized avatar

Brian J. McGuirk bmcguirk

View GitHub Profile
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@Black-Milk
Black-Milk / Main.sublime-menu
Last active October 22, 2018 11:51
Sublime REPL settings for Anaconda distribution of Python. Included are REPL settings for python and ipython running under python 2.7 and python 3.3. Be sure to provide the appropriate path to your Anaconda Python 2.7 and Python 3.3 executables within the lines that start with "cmd" .
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
@gavsmi
gavsmi / createdb-mssql.py
Last active August 29, 2015 14:04
Orchestra cloud-init script to create DB (MSSQL)
#! /usr/bin/python
import argparse, pymssql, logging
def parsed_args():
# parse cmd line args
parser = argparse.ArgumentParser(description='Create MSSQL database.')
parser.add_argument('--user',
help='Username to connect to MSSQL',
default='qmatic')
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active July 19, 2024 21:01
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead
package examples.docs
import com.atlassian.applinks.api.ApplicationLink
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
import com.atlassian.jira.issue.Issue
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.sal.api.net.Request
import com.atlassian.sal.api.net.Response
import com.atlassian.sal.api.net.ResponseException
@annacrotty
annacrotty / Salesforce Contact Update and Create.py
Created September 25, 2015 20:24
My first pandas python project. Comments and suggestions definitely welcome. More info at https://medium.com/@AnnaCrotty2/using-pandas-and-python-to-import-data-into-salesforce-118f39cd718b
# coding: utf-8
# In[297]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.options.display.max_rows = 2
@niloch
niloch / sankey_chart.py
Last active August 23, 2019 08:46
python sankey chart
from iplotter import GCPlotter
plotter = GCPlotter()
data = [
['From', 'To', 'Weight'],
['Brazil', 'Portugal', 5],
['Brazil', 'France', 1],
['Brazil', 'Spain', 1],
['Brazil', 'England', 1],
@chrisjsimpson
chrisjsimpson / dms2dec.py
Created April 1, 2019 12:17 — forked from jeteon/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.