Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View florapdx's full-sized avatar

florapdx florapdx

View GitHub Profile
@florapdx
florapdx / Customize Bash Prompt
Last active December 14, 2015 01:58
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".
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
florapdx / meetups_indiv.js
Created February 17, 2013 10:31
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 meetup.com (ie, <div …
// Make a single api call to meetup.com 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 pyladies.com/locations page.
//helper function to discover event urls and make active links
//credit to http://www.sencha.com/forum/archive/index.php/t-12379.html 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