Unicode Conversions in PHP and Remote Git Repos

Today I learned:

Converting Unicode quotation marks in PHP

Unicode quotation marks (sometimes called smart quotes) are those curved/slanted single and double quotation marks: “ ” ‘ ’. The ASCII ones look like this: " '. They are usually interchangeable in word processing, but the stylized ones sometimes cause issues on the web (in a parser, for example).

To convert one to the other in PHP, use iconv():

 $output = iconv('UTF-8', 'ASCII//TRANSLIT', $input);

If you use OS X and want to turn off smart quotes, go to System Preferences > Keyboard > Text and uncheck “Use smart quotes and dashes.”


Remote git repositories

Using git locally is one thing, but it is far more powerful (and exciting!) to push that code to a remote repository like Github for display and collaboration.

Assuming you have a local repository that wasn’t cloned from a remote one, you’ll need to hook it up to a remote repository:

$ git remote add origin 

If there is code already on the remote repository, you’ll need to merge it in to your local:

$ git pull $ git merge origin/master

Then push your committed files to the remote repository:

$ git push origin master

For a great beginner’s guide to git, check out Roger Dudler’s git – the simple guide.


Toggl Slash Command for Slack

Today I released my first personal project on Github: Toggl Slash Command for Slack.

It is a custom slash command that enables users to put time entries into Toggl from Slack.

If you use it, I’d love to know! It is in its rough early stages, but I have some future additions planned for it, so stay tuned.



Comments

Leave a Reply

Webmentions

If you've written a response on your own site, you can enter that post's URL to reply with a Webmention.

The only requirement for your mention to be recognized is a link to this post in your post's content. You can update or delete your post and then re-submit the URL in the form to update or remove your response from this page.

Learn more about Webmentions.