Skip to content

Instantly share code, notes, and snippets.

@josephzidell
josephzidell / @post
Created February 9, 2014 16:58
Markdown adding spaces - a simpler case
```html
<a href="mailto:404-Not-Found@example.com?subject=Hi!&amp;amp;body=Either type the email address or use the form. Thanks!"></a>
```
@josephzidell
josephzidell / gist:8864311
Created February 7, 2014 15:01
Sublime Search / Replace `$this->Model->exists(...) { throw ...}` to `$this->Model->check(...);`
Search:
```
(s?)\$this->(.*)->id = \$(.*);\n.*if \(!\$this->.*->exists\(\)\) \{\n.*throw new NotFoundException\(__\((.*)\)\);\n.*\}
```
Replace:
```
$this->\2->check($\3, \4);
```
@josephzidell
josephzidell / gist:8816548
Created February 5, 2014 02:35
Markdown content adding extra spaces in <code>

A quick search for "javascript email address obfuscation" yielded a stackoverflow answer to URL encode it, along with comments about how that doesn't work. The next result in Google was an Email Address Obfuscator, which in my experience caused issues on mobile devices.

Another idea which is pretty common, is to use myemailaddress at example dot com. I don't like it because robots are smarter than that.

The next best thing is an image. Just type the email address into your favorite image processing program and voilà, you have an image to use instead of your email address. Then you have to deal with :hover effects of links. In my case, a color change as well as a slight background change. No sweat, put both versions in the image, and use the CSS :hover property to move the image up.

![double-email-address-image](/assets/blog/quick-hide-th

@josephzidell
josephzidell / route_paths.php
Last active January 3, 2016 17:59
Pathify CakePHP routes
<?php
function root_path() {
return '/';
}
function pathify() {
foreach ( Router::$routes as $route ) {
$parts = [];
if ( isset( $route->defaults['prefix'] ) && !is_null( $route->defaults['prefix'] ) ) {
$parts[] = $route->defaults['prefix'];
@josephzidell
josephzidell / bundle env
Created January 5, 2014 00:14
`bundle env`
Bundler 1.3.5
Ruby 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
Rubygems 2.2.0
rvm 1.25.10 (stable)
GEM_HOME /home/wwc/.rvm/gems/ruby-2.0.0-p353
GEM_PATH /home/wwc/.rvm/gems/ruby-2.0.0-p353:/home/wwc/.rvm/gems/ruby-2.0.0-p353@global
rubygems-bundler (1.3.3)
Gemfile