Skip to content

Instantly share code, notes, and snippets.

View athlan's full-sized avatar

Piotr Pelczar athlan

View GitHub Profile
@ddimtirov
ddimtirov / 1. Keynote.md
Last active May 30, 2018 07:25
Tokyo Java Days 2018 notes

Highlights

  • long term roadmap for Java exists (Oracle is not reducing their investment despite shift in strategy to OSS and services)
  • opening up developments
  • cloud native recurring topic
  • money from services
  • new release model - same/better for devs, makes ent. pay
  • making Java the premier choice for cloud native is recurring topic

Notable Projects:

  • portola: containers (startup time, resource management)
@miglen
miglen / linux-networking-tools.md
Last active April 23, 2024 11:39
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
@wowo
wowo / pre-commit
Last active August 29, 2015 14:24
Basic pre-commit git hook
#!/bin/bash
exec < /dev/tty
phpunit
rc=$?
if [[ $rc != 0 ]] ; then
echo -n "It looks like some of your tests failed. "
exit $rc;
fi
@bartosz-maciaszek
bartosz-maciaszek / call_user_func_benchmark.php
Created September 29, 2014 18:11
Direct call vs call_user_func() vs call_user_func_array()
<?php
class Benchmark
{
private $start = null;
public function __construct()
{
$this->start = microtime(true);
}
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@matteocedroni
matteocedroni / SecurityChecker.java
Last active September 20, 2023 00:47
Programmatically check Spring Security expressions
import org.apache.log4j.Logger;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.security.access.expression.ExpressionUtils;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.util.SimpleMethodInvocation;
import java.lang.reflect.Method;
@ryan-frankel
ryan-frankel / VarnishWithWordPress.vcl
Last active January 16, 2017 19:13
WordPress Basic Varnish Config
/* SET THE HOST AND PORT OF WORDPRESS
* *********************************************************/
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# SET THE ALLOWED IP OF PURGE REQUESTS
# ##########################################################
acl purge {
@warpech
warpech / oferta_pracy.md
Last active August 29, 2015 13:57
Oferta pracy - Senior JavaScript Developer

Oferta pracy - Senior Web Components Developer (Gdynia)

🌊 Gdynia, 20 października 2014

Co robimy

Nextgen to :suspect::hurtrealbad: team programistów technologii JavaScript. Nasze biuro mieści się w PPNT w Gdyni. Poszukujemy programisty z doskonałą znajomością JavaScript i HTML5 do pracy przy nowym projekcie, opartym na Web Components i frameworku Polymer.

Polymer logo

@kdzwinel
kdzwinel / trilateration.js
Created January 3, 2014 09:35
Simple trilateration algorithm implementation in JavaScript.
function getTrilateration(position1, position2, position3) {
var xa = position1.x;
var ya = position1.y;
var xb = position2.x;
var yb = position2.y;
var xc = position3.x;
var yc = position3.y;
var ra = position1.distance;
var rb = position2.distance;
var rc = position3.distance;
@rybakit
rybakit / Chain.php
Last active February 1, 2023 14:35
Nested chain validator for symfony > 2.1
<?php
namespace Acme\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Constraints\Valid;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
* @Annotation