Skip to content

Instantly share code, notes, and snippets.

@i-stos
i-stos / persnav.js
Created April 23, 2012 15:22
JavaScript: jQuery Persistant Navigation Menu
/**
* Name: Persistant Navigation Menu
* Type: jQuery Plugin - jQuery v1.7.2
* Description: Makes any navigation menu or DOM element persistant
* Author: Billy Onjea (blog.istocode.com)
* --------------------------------------------------------------------
* Minimum CSS Classes:
* --------------------------------------------------------------------
* .persisting {
* position: fixed;
@i-stos
i-stos / index.php
Created April 23, 2012 15:06
PHP: Validate & Send simple e-mail
<?php
/**
* Validate & Send simple e-mail
*/
function validate_field ($field) {
$field = htmlspecialchars($field, ENT_QUOTES);
@i-stos
i-stos / MySQL-Guide.txt
Created April 23, 2012 14:26
MySQL: Basic MySQL Guide
==========================================================================================================
MySQL Guide - Basics
==========================================================================================================
Connect/Disconnect from MySQL Server
----------------------------------------------------------------------------------------------------------
:~ sudo mysqld_safe //Turns on MySQL server
:~ mysql -h host -u root -p //Connects to MySQL server: "no need to specify host on local"
mysql> quit; //Disconnects from MySQL
:~ mysqladmin -u root -p shutdown //Shuts down MySQL server
----------------------------------------------------------------------------------------------------------
@i-stos
i-stos / gist:2470859
Created April 23, 2012 13:15 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@i-stos
i-stos / html5-template.html
Created April 23, 2012 12:58
HTML5: Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Untitled Document </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">