Skip to content

Instantly share code, notes, and snippets.

View ollieread's full-sized avatar
👾
Build it all!

Ollie Read ollieread

👾
Build it all!
View GitHub Profile
package com.ollieread.technomagi.block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.ollieread.technomagi.TechnoMagi;
import com.ollieread.technomagi.common.CommonProxy;
<?php
$baseurl = 'http://myjenkinsurl/job/jobname';
$buildJsonDirty = @file_get_contents($baseurl . '/api/json');
if($buildJsonDirty) {
$buildJsonClean = json_decode($buildJsonDirty, true);
$builds = $buildJsonClean['builds'];
<?php
Route::group(['namespace' => 'ModBin\Controllers'], function()
{
Route::group(['prefix' => '/user'], function()
{
Route::group(['before' => 'guest'], function()
{
Route::get('/create', [
'as' => 'user.create',
<?php namespace Ollieread\Toolkit\Repositories;
class BaseRepository
{
public function setModel($model);
public function setValidator($validator);
public function setContext($context);
<?php
class MyValidator extends BaseValidator
{
public static $rules = [
'create' => [
'field' => ['rule1', 'rule2']
],
'update' => [
<?php
class Activity
{
public static function log(Model $user, Model $subject, $action)
{
$log = $this->user->logs()-.>create(['action'] => $action]);
$log->subject()->save($subject);
}
if($validator->fails()){
return Response::json(['error' => 1,
'msg'=>$validator->errors()
]);
}
else{
<?php
// This would be for the logs model
public function scopeCode($query, $code)
{
return $query->where('code', $code);
}
// Then this would be your main model
public function scopeNotTransferred($query)
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event)
{
if (event.entity instanceof EntityAgeable) {
EntityAgeable child = (EntityAgeable) event.entity;
if (child.isChild()) {
List parents = child.worldObj.getEntitiesWithinAABBExcludingEntity(child, AxisAlignedBB.getBoundingBox(child.posX, child.posY, child.posZ, child.posX + 4D, child.posY + 4D, child.posZ + 4D));
boolean flag = false;
int parentCount = 0;
<?php
// original
return array(
'driver' => 'eloquent',
'model' => 'User',