Skip to content

Instantly share code, notes, and snippets.

@lykkeligal
lykkeligal / email_validation.cs
Created May 16, 2012 13:06 — forked from jarrettmeyer/email_validation.cs
Email validation - the point is to show that the extension method doesn't actually do anything. The real logic is in the validator class.
public class EmailValidator
{
private const string PATTERN = "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$";
public static bool IsValid(string s)
{
if (string.IsNullOrEmpty(s))
return false;
// Regex from http://www.regular-expressions.info/email.html
@lykkeligal
lykkeligal / php: CI_classHeads
Created April 30, 2012 20:58
php: CI_classHeaders
<?php
/*class Con extends CI_Controller {
function __construct(){
parent::__construct();
}
}*/
/*class Mod extends CI_Model {
function __construct(){
parent::__construct();
}
@lykkeligal
lykkeligal / codeigniter_htaccess
Created April 30, 2012 20:51 — forked from muhittin/codeigniter_htaccess
Codeigniter htaccess
RewriteEngine On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1
@lykkeligal
lykkeligal / CSS: Eric Meyer Reset minified
Created April 30, 2012 20:27 — forked from crgr/CSS: Eric Meyer Reset minified
CSS: Eric Meyer Reset minified
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
@lykkeligal
lykkeligal / Javascript: jQuery ajax
Created April 30, 2012 20:24
Javascript: jquery ajax
$.ajax({
type: type,
url: url,
dataType: 'datatype',
});
@lykkeligal
lykkeligal / source.js
Created April 30, 2012 17:46 — forked from martinodehnal/source.js
Javascript: jQuery Document Ready
<script>
$(function() {
});
</script>
@lykkeligal
lykkeligal / html5_template.html
Created April 30, 2012 17:32 — forked from nathansmith/html5_template.html
Simple HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
<script src=""></script>