Skip to content

Instantly share code, notes, and snippets.

View matiit's full-sized avatar
:octocat:

Mateusz Tracz matiit

:octocat:
View GitHub Profile
@matiit
matiit / Makefile
Created May 13, 2019 22:25
Example makefile
all: check test
VIRTUAL_ENV := $(shell poetry config settings.virtualenvs.path|tr -d \")/websecmap-py3.6
export PATH := ${VIRTUAL_ENV}/bin:${PATH}
setup: ${VIRTUAL_ENV}/bin/websecmap
${VIRTUAL_ENV}/bin/websecmap: poetry.lock | ${poetry}
poetry install --develop=websecmap
test -f $@ && touch $@
#define len(a) ((int) (sizeof(a) / sizeof(*a)))
<?php
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
include './vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
package com.matiit.learn;
public class NoVariables {
public static void main() {
System.out.println(10*10);
System.out.println(10*10*10);
}
}
package com.matiit.learn;
public class Variables {
public static void main() {
int a;
int b;
a = 10;
b = 10;
<?php
$addedRows = 0;
(...)
// Keep the order
// Reset it here, not in the if, so it always! gets resetted.
$addedRowsToCurrent = 0;
if ($grouped == AdminList::GROUPED_FOR_TAX_RELIEF && $row['tax_allocation_exists'] == 1) {
/**
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
<?php
namespace JustPark\Tests\Unit\Auth;
use JustPark\Auth\ShareableLinkAuth;
class ShareableLinkAuthTest extends \PHPUnit_Framework_TestCase
{
public function test_it_generates_working_link()
{
<?php
public function getDates()
{
// In case it returns array of arrays:
return [
// You can specify second "element" which would be the name of the column with timezone values
['start_date', 'timezone'],
// Use default if second "argument" not provided
['some_other_date_field']
];
<?php
public function getDates()
{
// In case it returns array of arrays:
return [
// You can specify second "element" which would be the name of the column with timezone values
['start_date', 'timezone'],
// Use default if second "argument" not provided
['some_other_date_field']
];