Skip to content
Türker Yıldırım
Writing
Snippets
About
Search
Snippets
One-liners, regexes and short scripts worth keeping. Copy, adapt, move on.
Open a Bootstrap 2 modal from a link
bootstrap
css
html
javascript
Autoload classes with spl_autoload_register
oop
performance
php
psr
Show the indexes on a MySQL table
indexing
mysql
query-optimization
sql
Password-protect a directory with .htaccess
apache
deployment
linux
security
Round the corners of a box in every browser
css
html
javascript
jquery
Stop jQuery caching an AJAX GET request
html
javascript
jquery
php
Send mail through an SMTP server in CodeIgniter
codeigniter
logging
php
security
Change the WordPress site URL from the database
migrations
mysql
sql
wordpress
Find and repair crashed MyISAM tables
backup
bash
linux
mysql
Remove the WordPress version from the page head
php
security
wordpress
wp-plugins
Vertically center a block of unknown height
css
html
javascript
jquery
Serialise form fields into an object with jQuery
html
javascript
jquery
php
Read a query string parameter in JavaScript
css
html
javascript
jquery
Delete all post revisions from the database
mysql
performance
sql
wordpress
Target Internet Explorer with a conditional comment
css
html
javascript
jquery
Show the last query CodeIgniter ran
codeigniter
logging
mysql
php
Reset a WordPress password with a SQL query
mysql
security
sql
wordpress
Force a file download with the right headers in PHP
apache
html
php
security
Truncate a string at a word boundary in JavaScript
css
html
javascript
jquery
Center a div horizontally and vertically with CSS
css
html
javascript
jquery
Export a MySQL database over SSH without a temporary file
backup
bash
linux
mysql
security
sql
Enable gzip compression in Apache with mod_deflate
apache
caching
deployment
performance
Change the WordPress site URL with SQL
backup
mysql
sql
wordpress
Redirect every request to HTTPS in PHP
apache
deployment
php
security
Query WordPress posts by a custom field value
mysql
oop
php
wordpress
wp-plugins
Check whether a jQuery selector matched anything
css
html
javascript
jquery
Show the last SQL query CodeIgniter ran
codeigniter
mysql
php
query-optimization
Serve a stylesheet to IE6 only with a conditional comment
css
html
javascript
jquery
Make a whole table row clickable with jQuery
css
html
javascript
jquery
Reload Apache without dropping active connections
apache
bash
deployment
linux
Register a class autoloader in PHP
codeigniter
deployment
oop
php
Newer
1
…
4
5
6