Skip to content

Instantly share code, notes, and snippets.

View Strernd's full-sized avatar

Bernd Strehl Strernd

View GitHub Profile
<?php namespace App\Http\Controllers;
class HomeController extends Controller {
}
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
abstract class CrudController extends Controller {
protected $model = null;
import sys
def cross(X,Y):
l = sum = 0
for i in reversed(X):
sum = sum + i
if sum > l:
l = sum
r = sum = 0
for i in Y:
/*********************************************
* OPL 12.7.0.0 Model
* Author: Bernd
* Creation Date: 26.11.2016 at 18:12:32
*********************************************/
range warehouses = 1..3;
range retailers = 1..4;
int cost[warehouses][retailers] = [[35,30,40,32],[37,40,42,25],[40,15,20,28]];
int stock[warehouses] = [1200,1000,800];
/*********************************************
* OPL 12.5.1.0 Model
* Author: BAT4769
* Creation Date: Dec 5, 2016 at 11:14:35 AM
*********************************************/
int n=4; // cargos
int m=3; // compartments
range cargos = 1..n;
/*********************************************
* OPL 12.5.1.0 Model
* Author: BAT4769
* Creation Date: Dec 5, 2016 at 11:14:35 AM
*********************************************/
int n=4; // cargos
int m=3; // compartments
int a=2; // aircrafts
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Voronoi</title>
</head>
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
const Voronoi = require( 'voronoi' );
const _ = require( 'lodash' );
const canvas = document.getElementById( "canvas" );
const ctx = canvas.getContext( "2d" );
const v = new Voronoi();
const max = {
x: 800,
y: 800
};
const Voronoi = require( 'voronoi' );
const _ = require( 'lodash' );
const canvas = document.getElementById( "canvas" );
const ctx = canvas.getContext( "2d" );
const v = new Voronoi();
const max = {
x: 800,
y: 800
};
const bbox = {
@Strernd
Strernd / AdvertMarket.sol
Last active July 30, 2018 14:57
Contract code for the tutorial on https://medium.com/p/9d2341a80e7d
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract AdvertMarket is Ownable{
event NewAdvert(uint id, bytes32 meta, uint price, address sender);
event AdvertChangedOwner(uint id, uint price, address newOwner, uint newPrice);
event AdvertDataChanged(uint id, bytes32 data);
uint maxPriceFactor = 2; // max factor the price can increase at owner change