Skip to content

Instantly share code, notes, and snippets.

View rintaun's full-sized avatar

Matthew Lanigan rintaun

View GitHub Profile
@rintaun
rintaun / Date
Created December 20, 2011 14:54 — forked from anonymous/Date
Date code
<?php
//This is for PRACTICE only!
$d=date('D', strtotime('-1 day'));
if ($d=="Tue")
echo "Have a nice Tuesday!";
elseif ($d=="Mon")
echo "Have a nice Monday!";
else
<?php
class Model {
/**
* Load a row from the database
*
* Pulls data from the database for a given model into the object. Note
* that this clears any state (modifications/etc.) that have been set
* on the object first, for any Model-controlled columns.
@rintaun
rintaun / pagerank.php
Created April 24, 2012 14:12 — forked from anonymous/pagerank.php
Hashing algoriths for Page Rank
<?php
// Function d checks
function d($a, $b) {
//$c = intval(8E7, 16);//80000000
$c = 2147483648;
$a = $a & 0xffffffff;
if ($c & $a) {
$a >>= 1;
$a &= ~$c;
$a = $a | 1073741824;
@rintaun
rintaun / dump
Created May 3, 2013 19:00 — forked from anonymous/dump
-- Control frame information -----------------------------------------------
c:0087 p:---- s:0449 e:000448 CFUNC :read
c:0086 p:0041 s:0445 e:000444 BLOCK /home/rintaun/.rvm/gems/ruby-2.0.0-p0@myce/gems/sinatra-assetpack-0.2.2/lib/sinatra/assetpack/buster_helpers.rb:7 [FINISH]
c:0085 p:---- s:0442 e:000441 CFUNC :map
c:0084 p:0010 s:0439 e:000438 METHOD /home/rintaun/.rvm/gems/ruby-2.0.0-p0@myce/gems/sinatra-assetpack-0.2.2/lib/sinatra/assetpack/buster_helpers.rb:7
c:0083 p:0009 s:0434 e:000433 METHOD /home/rintaun/.rvm/gems/ruby-2.0.0-p0@myce/gems/sinatra-assetpack-0.2.2/lib/sinatra/assetpack/buster_helpers.rb:25
c:0082 p:0011 s:0428 e:000427 BLOCK /home/rintaun/.rvm/gems/ruby-2.0.0-p0@myce/gems/sinatra-assetpack-0.2.2/lib/sinatra/assetpack/package.rb:65 [FINISH]
c:0081 p:---- s:0424 e:000423 IFUNC
c:0080 p:---- s:0422 e:000421 CFUNC :each
c:0079 p:---- s:0420 e:000419 CFUNC :map