Skip to content

Instantly share code, notes, and snippets.

@bohnna
bohnna / gist:1aeb805862e0240c77e1a1375977cfd1
Created August 15, 2016 17:58
Wrap a span tag around all instances in a string that are surrounded by 4 asterisks.
public static function span_strings($string, $class = null) {
/* Takes a string, and surrounds anything surrounded by 4 asterisks with
* a span tag with an optional class name.
*
* If a class is specified in the second argument, it will add
* a class to the span tag.
*/
$match_phrase = "/\*\*([^**]*)\*\*/";
$replace_string = '<span';
@bohnna
bohnna / gist:bd5eca3ddf94b2b66c8c517e6fe52792
Last active August 15, 2016 17:56
Wrap a span around all instances in a string that match a regular expression.
public static function span_strings($string, $class = null) {
/* Takes a string, and surrounds anything surrounded by 4 asterisks with
* a span tag with an optional class name.
*
* If a class is specified in the second argument, it will add
* a class to the span tag.
*/
$match_phrase = "/\*\*([^**]*)\*\*/";
$replace_string = '<span';
@bohnna
bohnna / gist:e25cc6a3aeb0580e749184a8037985e0
Created July 8, 2016 01:40
Solution: Getting a 201 Error when trying to update or install Adobe Creative Cloud for OSX
This is from a chat with their technical support. Their actual troubleshooting guide only tells you to reboot, uninstall, and reinstall. This should be in their support page.
Go to ~/Library/Application Support/Adobe
Remove the OOBE and AAMUpdater folders
Go to /Library/Application Support/Adobe
Remove the OOBE, AAMUpdater and AdobeApplicationManager folders
Go to your Applications folder and delete the Adobe Creative Cloud folder (if it exists)
// The whole idea is to set the parent_slug to 'edit.php?post_type=cpt-name
// Everything else you can customize as you need to.
// Replace {posttype} with your post type name. (Without the brackets of course)
${posttype}_options_page = acf_add_options_page(array(
'page_title' => '{posttype} Options',
'menu_title' => '{posttype} Options',
'menu_slug' => 'acf-cpt-{posttype}',
'capability' => 'edit_posts',
'position' => false,
@bohnna
bohnna / finalize.sh
Created April 11, 2016 14:58 — forked from jescalan/finalize.sh
Finalize
#!/bin/sh
# Installation instructions:
# - Download the file
# - mv finalize.sh finalize
# - chmod +x finalize
# - mv finalize /usr/local/bin
# - now you can type `finalize` in any directory and it should work
# NOTE: this will rename all the files in your current directory, so be careful
@bohnna
bohnna / gist:5295666dc02ed073acd1
Last active June 7, 2016 16:59
Atlanta Agencies & Companies with UX focus
// Agencies
Launch [launchjourney.com] Digital Strategy, UX
Huge Atlanta [hugeinc.com] Digital Strategy, Full Digital, UX
Focus Lab [focuslabllc.com] Branding, EE
Razorfish [razorfish.com] - Full Service
FourtyFour [fourtyfour.com] Digital, Design, Product, UX
Adrenaline [adrenalineshot.com] Experience Design
JDA [jdaworldwide.com] - National Full Service Advertising, Branding. They're a network of agencies.
BBDO [bbdoatl.com] - Advertising Agency
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@bohnna
bohnna / store_hours.php
Last active October 9, 2015 02:51
Wordpress functions to gather store hours and group them according to hours, then output the results as a list, with an optional parameter for class name.
function get_hours_array() {
$shop_hours_array = array();
if (have_rows('hours') ) {
while (have_rows('hours') ) {
the_row();
$shop_hours_array[get_sub_field('acf_fc_layout')] = array(
'open' => get_sub_field('open_time'),
'close' => get_sub_field('close_time')
@bohnna
bohnna / blah.php
Last active October 8, 2015 23:42
function blahblahblah() {
$hours = get_op_hours();
$current_time = dateTime::createFromFormat('h:i a', date('h:i a', current_time('timestamp')));
$close_time = dateTime::createFromFormat('h:i a', $hours['close']);
$open_time = dateTime::createFromFormat('h:i a', $hours['open']);
if (is_business_open($hours['open'], $hours['close'])) {
$diff = $close_time->diff($current_time);
@bohnna
bohnna / multiple_ssh_setting.md
Created September 26, 2015 18:44 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"