Skip to content

Instantly share code, notes, and snippets.

@chrisamoore
chrisamoore / index.php
Created June 9, 2012 15:48 — forked from tzusman/index.php
Visitor tracking with PHP and Redis
<?
/**
* Read about why this script was written at http://blog.toddzusman.com/post/13291374815/visitor-tracking-using-php-and-redis
*/
// I'm using Predis from https://github.com/nrk/predis
require '/path/to/predis/lib/Predis/Autoloader.php';
Predis\Autoloader::register();
@chrisamoore
chrisamoore / dabblet.css
Created December 19, 2012 01:43
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@chrisamoore
chrisamoore / Class.php
Created January 28, 2013 19:30
Mediator use in separate class
<?php
class Order
{
public $id;
function __construct($id)
{
$this->mediator = new Mediator();
}
@chrisamoore
chrisamoore / Data.json
Last active December 14, 2015 02:39
Dc.js Attempt.
var data = [
{
"client_name" : "foo",
"date" : "2012-02-16"
},
{
"client_name" : "foo",
"date" : "2012-02-16"
},
{
Hi
I hope this helps you all get started with phonegap and sqlite in your
application
Dean-O
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
@chrisamoore
chrisamoore / Web SQL
Created February 26, 2013 00:10
Web SQL
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- Change this if you want to allow scaling -->
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
<title>Embedded Sql Example</title>
<!-- include the next line to use phonegap javascript functions -->
@chrisamoore
chrisamoore / Index.html
Created February 28, 2013 23:45
Variable Object properties in JS
<!doctype html>
<html>
<head>AJAX OBJ TEST</head>
<body>
Testy AJAX !
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(document).ready(function($) {
var foo = {};

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@chrisamoore
chrisamoore / make_path.php
Last active December 17, 2015 02:29
Interpolated String Issue
<?php
// I want this to work but I don't want to split and rejoin for operators
if(strpos($data, '.') !== false){
$data = self::makePath($data);
// client->client_name
return self::$order->{$data};
}
// This Works
if(strpos($data, '.') !== false){
$result = preg_replace("/(?<=<row\\sr=\\\")[0-9]+(?=\\\">)|(?<=\\sr\\=\\\")([A-Z]+)([0-9]+)(?=\\\")/usx", "5", $searchText);