Skip to content

Instantly share code, notes, and snippets.

@art2code
art2code / h5bp-twitter-bootstrap
Created March 9, 2012 22:52 — forked from paulirish/h5bp-twitter-bootstrap
h5bp + twitter bootstrap integration
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@art2code
art2code / Get Current URL With PHP
Created April 5, 2012 07:05
Get Current URL With PHP
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
@art2code
art2code / gist:2584441
Created May 3, 2012 08:48
php: check if js and cookie enabled
<?php
ob_start();/* header buffer */
session_start();
### Make cookies if they don't exist #######################
if(!$_SESSION['exists']){
$_SESSION['exists']= 'off';
setcookie("exits", "data");
}
### Test for $_SESSION cookies being enabled ##############