Skip to content

Instantly share code, notes, and snippets.

View jorgepedret's full-sized avatar
😀
Turned on by Open Source

Jorge Pedret jorgepedret

😀
Turned on by Open Source
View GitHub Profile
@jorgepedret
jorgepedret / Start Class Button
Created April 12, 2011 23:43
Button to start a class
<a href="/start-a-class/" class="button">Start this Class</a>
@jorgepedret
jorgepedret / tg-effect.html
Created April 22, 2011 21:07
CSS background image transition effect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body{
font-family: Helvetica, Arial, sans-serif;
font-size: 100%;
line-height: 1.4em;
background: #000 url(body-bg.png) left bottom repeat-x;
@jorgepedret
jorgepedret / first-table
Created May 28, 2011 02:22
First table
<table cellpadding="0" cellspacing="0" class="c19"><tbody><tr><td class="c10"><p class="c0"><span class="c2">Homophones (meaning)</span></p></td><td class="c9"><p class="c0"><span class="c2">Example</span></p></td></tr><tr><td class="c10"><p class="c0"><span>ad (advertisement)</span></p><p class="c0"><span>add (addition)</span></p></td><td class="c9"><p class="c0"><span>Did you see this </span><span class="c7">ad </span><span>in the newspaper?</span></p><p class="c0"><span>Did you </span><span class="c7">add </span><span>and subtract the numbers correctly?</span></p></td></tr><tr><td class="c10"><p class="c0"><span>allowed (permitted)</span></p><p class="c0"><span>aloud (audible)</span></p></td><td class="c9"><p class="c0"><span>No one is </span><span class="c7">allowed </span><span>in the building after dark.</span></p><p class="c0"><span>No one wanted to read </span><span class="c7">aloud </span><span>to the group.</span></p></td></tr><tr><td class="c10"><p class="c0"><span>band (orchestra)</span></p><p cla
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:11
Htaccess to Remove www in URL with
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:12
Htaccess Prevent hotlinking
RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:12
Redirect all WordPress feeds to feedburner (htaccess)
<IfModule mod_alias.c>
RedirectMatch 301 /feed/(atom|rdf|rss|rss2)/?$ http://feedburner.com/yourfeed/
RedirectMatch 301 /comments/feed/(atom|rdf|rss|rss2)/?$ http://feedburner.com/yourfeed/
</IfModule>
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:13
Create custom error pages (htaccess)
ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:13
Force download of specific files (htaccess)
<Files *.xls>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
<Files *.eps>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:13
Log PHP errors (htaccess)
# display no errs to user
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
# log to file
php_flag log_errors on
php_value error_log /location/to/php_error.log
@jorgepedret
jorgepedret / .htaccess
Created June 6, 2011 22:14
Remove file extensions from urls (htaccess)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
# Replace html with your file extension, eg: php, htm, asp