Skip to content

Instantly share code, notes, and snippets.

@rizz0
rizz0 / gist:5041583
Last active December 14, 2015 06:19
Simple class extension example.
<?php
class Organ {
public function __construct($name){
$this->name = $name;
}
public function kill(){
echo $this->name.' died!<br/>';
class FastEloquent extends Eloquent {
public function __get($key) {
if (array_key_exists($key, $this->attributes)) {
return $this->attributes[$key];
}
return parent::__get($key);
}
}
var msg1 = "Did you know that your Internet Explorer is out of date?";
var msg2 = "To get the best possible experience using our website we recommend that you upgrade to a newer version or other web browser. A list of the most popular web browsers can be found below.";
var msg3 = "Just click on the icons to get to the download page";
var br1 = "Internet Explorer 7+";
var br2 = "Firefox 3+";
var br3 = "Safari 3+";
var br4 = "Opera 9.5+";
var br5 = "Chrome 2.0+";
@rizz0
rizz0 / Index.php
Created January 21, 2017 16:44
The early days...
<?php
error_reporting(0);
//$serverStatus = 'fucked';
if($serverStatus == 'fucked' && $_SERVER['REMOTE_ADDR'] != getAdminIP()){
header('HTTP/1.1 503 Service Unavailable');
@header("Status: 503 Service Temporarily Unavailable");
echo 'We are temporarily down for maintenance. Sorry!';
CREATE OR REPLACE FUNCTION `bigquery-project.dataSet.countParticipants`
(
arr STRUCT<STRING, FLOAT64>
)
RETURNS NUMERIC LANGUAGE js AS """
return arr.length;
""";
CREATE OR REPLACE FUNCTION `bigquery-project.dataSet.countParticipants`
(
arr STRUCT<name STRING, score FLOAT64>
)
RETURNS NUMERIC LANGUAGE js AS """
return arr.length;
""";