Skip to content

Instantly share code, notes, and snippets.


Flora Worley florapdx

View GitHub Profile
florapdx / Customize Bash Prompt
Last active Dec 14, 2015
How-to for customizing your bash prompt. For PyLadies tutorial on the CLI. You can also find this in a slightly more readable form on the PyLadies PDX meetup site under "Pages".
View Customize Bash Prompt
Customize Your Bash Prompt
Your bash prompt comes with a standard command prompt with a default setting something like “PS1="\u@\h \w>” in your .bash_profile or .profile (if you are using OSX) that translates to something like this:
UserName YourComputerName DirectoryName $
While useful, this is kind of boring and doesn’t give us very much information about the environment we’re working in. So let’s customize our prompts!
florapdx / meetups_indiv.js
Created Feb 17, 2013
This code brings in JSON data for multiple entities (in this case Pyladies groups) in a single call to a public api, and then manipulate that data after retrieval for placement in separate entity-owned divs on a web page. In this case I identified each div using an html5 data-attribute given the group_id # assigned to it by (ie, <div …
View meetups_indiv.js
// Make a single api call to and grab event info for all (11) PyLadies locations. Create individual objects for each so that meetups can be added to each pyladies group's div on page.
//helper function to discover event urls and make active links
//credit to for code this is based on
function create_urls(input) {
return input
.replace(/(ftp|http|https|file):\/\/[\S]+(\b|$)/gim, '"$&" target="_blank"')
.replace(/([^\/])(www[\S]+(\b|$))/gim, '"http://$2" target="_blank"');
} //end url parsing helper function
You can’t perform that action at this time.