// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo true ? 'car' : true ? 'horse' : 'feet'; #horse | |
echo true ? 'car' : false ? 'horse' : 'feet'; #horse | |
echo false ? 'car' : false ? 'horse' : 'feet'; #feet | |
echo false ? 'car' : true ? 'horse' : 'feet'; #horse | |
echo false ? 'car' : null ? 'horse' : 'feet'; #feet | |
echo true ? 'car' : null ? 'horse' : 'feet'; #horse | |
echo null ? 'car' : null ? 'horse' : 'feet'; #feet | |
echo null ? 'car' : false ? 'horse' : 'feet'; #feet | |
echo null ? 'car' : true ? 'horse' : 'feet'; #horse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getLocation( $y0, $x0, $rad ) { | |
$rad = $rad / 111195.0; | |
echo '$rad: '.$rad."\n"; | |
$u = (float)mt_rand() / (float)getrandmax(); | |
$v = (float)mt_rand() / (float)getrandmax(); | |
echo 'rand: '.$v.' '.$u."\n"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function clearCookies($cookiejar = 'cookies') { | |
@unlink($cookiejar); | |
} | |
function POSTURL( | |
$url, | |
$referer = "", | |
$data = array(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
if ($uri ~* ^/([^.\?/]+)) { | |
set $foldername "$1"; | |
} | |
sub_filter "<head>" "<head><base href=\"${scheme}://${host}/${foldername}/\">"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Who Am I?</title> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsfiddle.net/96q4m/17/ - old | |
// simulating GET variables | |
if(window.location.search.indexOf('test') < 0) window.location.search = window.location.search+'?test=123&img=https%3A%2F%2Fdrupal.org%2Ffiles%2Ftest-all-the-things.jpg'; | |
// remove everything above this line - stop removing after | |
// closure compiled: | |
$(function(){function a(a){return decodeURIComponent(a.replace(b," "))}for(var b=/\+/g,c=/([^&=]+)=?([^&]*)/g,d=window.location.search.substring(1);y=c.exec(d);)$("#tpl-"+a(y[1])).length&&("IMG"!==$("#tpl-"+a(y[1]))[0].tagName?$("#tpl-"+a(y[1])).html(a(y[2])):$("#tpl-"+a(y[1])).attr("src",a(y[2])))}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Common; | |
use \Illuminate\Html\FormBuilder; | |
class FormBuild extends FormBuilder { | |
protected function getRouteAction( $options ) { | |
if( is_array( $options ) ) { | |
return $this->url->route( $options[0], array_slice( $options, 1 ), 0 ); | |
} | |
return $this->url->route( $options, [], 0 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
OlderNewer