Skip to content

Instantly share code, notes, and snippets.

@ChrisMcKee
ChrisMcKee / rakefile.rb
Created April 25, 2011 21:32 — forked from jonhilt/rakefile.rb
A simple Rake build script example
require 'albacore'
require 'fileutils'
PROJECT_NAME = "Your Project Here"
DOT_NET_PATH = "C:/Windows/Microsoft.NET/Framework/v4.0.30319/"
NUNIT_PATH = "Tools/nunit/"
MSPEC_PATH = "Tools/mspec/"
PROJECT_CONFIG = (ENV['PROJECT_CONFIG'] == nil) ? "Debug" : ENV['PROJECT_CONFIG']
COMPANY_NAME = "Your Company Here"
BUILD_NUMBER = (ENV['BUILD_NUMBER'] == nil) ? "1.0.0.0" : ENV['BUILD_NUMBER']
require 'rake'
require 'albacore'
build_dir = "../build"
bin_dir = "#{build_dir}/bin"
src_dir = "../src"
solution = "#{src_dir}/Example.sln"
release_dir = "#{build_dir}/release"
package_dir = "#{build_dir}/package"
function PagnationStr(totalPgs, currentPg)
{
var pageSet = 10,
indexUrl = "//mydomain.com/page/",
tmp = "<div class=\"pagination\"><ul>",
maxpage = currentPg + 9,
crtarget = currentPg,
i = 0;
@ChrisMcKee
ChrisMcKee / DisplayFlickrGroup.html
Created May 18, 2011 08:21
Display Flickr Groups with JavaScript (& jQuery)
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title></title>
@ChrisMcKee
ChrisMcKee / .gitignore
Created June 9, 2011 12:54
.gitignore file for magento projects
.htaccess
.htaccess.sample
LICENSE.html
LICENSE.txt
LICENSE_AFL.txt
RELEASE_NOTES.txt
app/*.*
app/*/*.*
app/*/*/*.*
!app/etc/modules/<Namespace>_*.xml
@ChrisMcKee
ChrisMcKee / AESEncryptionHelper.cs
Created June 27, 2011 12:13
AES Encryption for Passing Parameters in the URL
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Web;
namespace xxx.xxxx.Shared.Application
{
public class AESEncryptionHelper
{
@ChrisMcKee
ChrisMcKee / Top500ShitPasswords.txt
Created June 29, 2011 10:20
The 2011 Top 500 Shit (Most Used) Password List
123456
password
12345678
1234
pussy
12345
dragon
qwerty
696969
mustang
@ChrisMcKee
ChrisMcKee / phpautoloader.php
Created October 6, 2011 20:52
PHP AutoLoad Magic Method, this is for pre SPL implementations
<?php
function __autoload ($class_name)
{
if (!class_exists($class_name, false)) {
$class_file_path = str_replace('_', '/', $class_name) . '.php';
require($class_file_path);
}
}
@ChrisMcKee
ChrisMcKee / RDM_Utility.php
Created October 6, 2011 21:58
PHP Utility Class
<?php
class RDM_Utility {
public static function generateGUID() {
$guid = '';
$time_low = str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT) . str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT);
$time_mid = str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT);
@ChrisMcKee
ChrisMcKee / RDM_DataSecurity.php
Created October 6, 2011 22:02
Data Cleansing Class
<?php
class RDM_DataSecurity {
// this basic clean should clean html code from
// lot of possible malicious code for Cross Site Scripting
// use it whereever you get external input
static function basicClean($string) {
if (get_magic_quotes_gpc()) {