Skip to content

Instantly share code, notes, and snippets.

Joshua Thijssen jaytaph

Block or report user

Report or block jaytaph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1aebce583d657df284dccf7afd38ea3f
<?php
namespace App\Services;
use Psr\Http\Message\RequestInterface;
use Zipkin\Propagation\RequestHeaders;
use Zipkin\Tracing;
class ZipkinGuzzleMiddleware {
View ctail.sh
# Display Symfony2 logging with different coloring for different error levels
tail -f var/logs/*.log | gawk '
/ERROR/ { print "\033[31m" $0 "\033[39;0m"; next; fflush();}
/CRITICAL/ { print "\033[41;33;1m" $0 "\033[39;0m"; next; fflush();}
/DEBUG/ { print "\033[34;1m" $0 "\033[39;0m"; next; fflush();}
/INFO/ { print "\033[32;1m" $0 "\033[39;0m"; next; fflush();}
$0; fflush();
'
View gist:8d4b56ba47008398789ca8d2da4fe363
Ports A and B each consist of an 8-bit Peripheral
Data Register (PR) and an 8-bit Data Direction Register
(DDR).
If a bit in the DDR is set to the corresponding bit
in the PR is an output, if a DDR bit is set to a zero, the
corresponding PR bit is defined as an input.
On a READ, the PR reflects the information present on the
actual port pins (PA0-PA7, PBOPB7) for both input and
@jaytaph
jaytaph / roadrace.py
Created Dec 10, 2016
Pygame RoadRace game
View roadrace.py
import math
import pygame
import numpy as np
class Car(pygame.sprite.Sprite):
def __init__(self, surface):
self.bounded_rect = surface.get_rect()
super(Car, self).__init__()
View arduino-lcd.c
#include <Wire.h>
#define NEXTCMD 128 // Issue when there will be more commands after this one
#define LASTCMD 0 // Issue when when this is the last command before ending transmission
/* Constants and default settings for the PCF */
// MODE SET
#define MODESET 64
@jaytaph
jaytaph / example.php5
Created Feb 26, 2016
Transpilation example
View example.php5
<?php
declare(strict_types=1);
function foobar(int $arg1, string $arg2) : int
{
return 42;
}
foobar(1, "foo");
@jaytaph
jaytaph / composer.json
Created Jan 15, 2016
Using the Symfony security component as standalone
View composer.json
{
"name": "jaytaph/security-example",
"require": {
"symfony/security-core": "~2.8"
},
"authors": [
{
"name": "Joshua Thijssen",
"email": "jthijssen@noxlogic.nl"
}
View readline.diff
diff --git a/Helper/QuestionHelper.php b/Helper/QuestionHelper.php
index 3707ffe..781eff3 100644
--- a/Helper/QuestionHelper.php
+++ b/Helper/QuestionHelper.php
@@ -30,6 +30,7 @@ class QuestionHelper extends Helper
private $inputStream;
private static $shell;
private static $stty;
+ private $readlinePrompt;
View DynamicValueObjectMapper.php
<?php
namespace Rainbow\FormBundle\Form\DataMapper;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Exception;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
View color.sf
import io;
class Color {
// Keeps numerical RGB value of the color
protected property value;
// Internal list of color names and RGB pairs.
protected property names = hash[[
"white" : 0xFFFFFF,
You can’t perform that action at this time.