Skip to content

Instantly share code, notes, and snippets.

View gist:8802830
<?php
if(isset($_GET['event'])) {
// Does the model have this attribute? If not raise an error
$this->event = $_GET['event'];
$this->id = $_GET['id'];
$this->relayer = $_GET['relayer'];
$this->relayer_phone = $_GET['relayer_phone'];
$this->phone = $_GET['phone'];
$this->text = $_GET['text'];
$this->time = $_GET['time'];
View gist:9149535
add_filter('template_redirect', 'my_404_override');
add_filter('the_content', 'my_content_override');
function my_404_override()
{
global $wp_query;
if (true) {
status_header(200);
$wp_query->is_404 = false;
View update.php
<?php
$runtimePath = '/home/user/app/runtime';
if (!empty($_GET['project'])) {
if (in_array($_GET['project'], array('app'))) {
file_put_contents($runtimePath . '/update-' . $_GET['project'], '');
}
}
@cornernote
cornernote / JohnYiiBase.php
Last active Aug 29, 2015
Yii Base Extended
View JohnYiiBase.php
<?php
/**
* Include the Yii Framework
*/
require_once(YII_PATH . DS . 'YiiBase.php');
/**
* Yii is a helper class serving common framework functionalities.
*/
class Yii extends YiiBase
View test.lua
minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode", water_level=-32000})
end)
View PostsController.php
<?php
class PostsController extends Controller
{
public function actionLike($id)
{
$model = $this->loadModel($id);
$model->views = $model->views + 1;
$model->save();
@cornernote
cornernote / view.php
Created Feb 28, 2015
giiant missing code to render related data?
View view.php
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\DetailView;
use yii\widgets\Pjax;
/**
* @var yii\web\View $this
* @var app\models\System $model
View gist:f16a687a80e7d18618d6
<?php
Mustache_Template->render(array("cards" =>
array(21567 => array(
array("id" => "21567",
"cardname" =>
"Tasigur%2C+the+Golden+Fang",
"rarity" => "R",
"set" => "FRF", ...),
array("id" => "21567",
View gist:dfb50cda434b714900d5
root@test:/vagrant/workflow# php composer.phar require --prefer-dist schmunk42/yii2-packaii "*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package schmunk42/yii2-packaii could not be found in any version, there may be a typo in the package name.
Potential causes:
@cornernote
cornernote / patch.diff
Created Apr 10, 2015
osTicket v1.9.6 header redirect after action
View patch.diff
From 885c04811fa0fdf8301fe45d8fccee49b7c5a7c6 Mon Sep 17 00:00:00 2001
From: cornernote <cornernote@gmail.com>
Date: Fri, 10 Apr 2015 09:32:02 +0930
Subject: [PATCH] #11883 duplicate tickets
---
upload/include/staff/header.inc.php | 2 ++
upload/scp/tickets.php | 28 ++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)