Skip to content

Instantly share code, notes, and snippets.

<?php
$app->get('/exception', function ($req, $res, $args) {
// errorHandler will trap this Exception
throw new Exception("An error happened here");
});
$app->get('/php7', function ($req, $res, $args) {
$x = function (int $x) {
return $x;
};
<?php
/*==============================================================================
* Register the error handler
*/
$whoops = new \Whoops\Run;
if ($environment !== 'production') {
// show errors for cool kids
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
// log exception
@synsh
synsh / monolog.php
Created August 7, 2017 13:07 — forked from mamchenkov/monolog.php
Example use of Monolog logger
<?php
// Before: composer require monolog/monolog
// composer autoloader
require_once 'vendor/autoload.php';
// Shortcuts for simpler usage
use \Monolog\Logger;
use \Monolog\Formatter\LineFormatter;
use \Monolog\Handler\StreamHandler;
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
#include<stdio.h>
#include<math.h>
float f(float x){
return (4*x-3*x*x);
/*
return (1/(1+x*x));
*/
}
#include<stdio.h>
#include<math.h>
float f(float x){
return exp(x);
/*
return sqrt(1 - 0.162 * sin(x) * sin(x));
*/
}
#include<stdio.h>
#include<graphics.h>
int main()
{
int maxx,s_angle,i,r,e_angle,x,y,maxy,gd,gm,maxr;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
maxx=getmaxx();
#include<stdio.h>
#include<graphics.h>
#include<math.h>
int main()
{
int gd,gm;
int r,i,a,b,x,y;
float PI=3.14;
detectgraph(&gd,&gm);
#include<stdio.h>
#include<graphics.h>
int main()
{
int gd,gm,x,y,r,i,j=0,maxx,maxy,high;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
//road
setcolor(WHITE);
#include<stdio.h>
#include<graphics.h>
void flood_fill(int x,int y,int old_color,int fill_color);
int main()
{
int gd,gm,x,y,x1,x2,y1,y2;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C://TurboC3//BGI");
printf("Enter top-left point of rectangle: ");