Skip to content

Instantly share code, notes, and snippets.

View MikeRogers0's full-sized avatar
πŸš‚

Mike Rogers MikeRogers0

πŸš‚
View GitHub Profile
@MikeRogers0
MikeRogers0 / httpd-vhosts.conf
Created November 24, 2012 23:02
Fix apache vhosts permissions on Mountain Lion
#
# Let me see the damn files. Replace <Your-Username> with your mac username (lowercase).
<Directory "/Users/<your-username>/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@MikeRogers0
MikeRogers0 / vhosts-off.sh
Created November 24, 2012 22:44
Turn on vHosts in OSX
# Virtual hosts
#Include /private/etc/apache2/extra/httpd-vhosts.conf
@MikeRogers0
MikeRogers0 / showHiddenFiles.sh
Created November 24, 2012 22:39
Show hidden files on Mountain Lion
defaults write com.apple.Finder AppleShowAllFiles YES; killall -HUP Finder
@MikeRogers0
MikeRogers0 / currentConnections.sh
Created November 20, 2012 18:20
List current connections on OSX
lsof -i | grep -E "(LISTEN|ESTABLISHED)"
@MikeRogers0
MikeRogers0 / dropdown.html
Created October 28, 2012 16:00
Pure CSS DropDown
<style type="text/css">
<!–
/* Style the links */
#exmaplebox a {
float:left;
text-decoration:none;
font-size:14px;
font-weight:bold;
height: 22px;
width: 100px;
@MikeRogers0
MikeRogers0 / cancel-shutdown.bat
Created June 16, 2012 17:46
How to do a timed shutdown on your PC
shutdown -a
@MikeRogers0
MikeRogers0 / nth-child.css
Created June 16, 2012 17:34
Making Zebra Stripes with CSS3
ul#example_list li:nth-child(odd) {
background-color:#FFF;
}
<form>
<fieldset>
<label>Phone Number:
<input name="price" type="text" value="090 111 050" /></label>
</fieldset>
</form>
@MikeRogers0
MikeRogers0 / mysql-replace.sql
Created June 16, 2012 17:24
MySQL REPLACE function
REPLACE('Original String', 'Find This', 'Replace with this')
# So it can be used like:
SELECT REPLACE('My Original String', 'Original', 'Modified');
# This will output: My Modified String
# So if you wanted to go through a full table and replace a bunch of strings, you could use it like this:
UPDATE `table_name` SET `field_name` = REPLACE(`field_name`, 'Find Me', 'Replace with Me');
@MikeRogers0
MikeRogers0 / .htaccess
Created June 16, 2012 17:21
Cookieless domains
CookieDomain www.fullondesign.co.uk