Skip to content

Instantly share code, notes, and snippets.

View tiraeth's full-sized avatar

Marcin Chwedziak tiraeth

View GitHub Profile
@tiraeth
tiraeth / gist:1306602
Created October 22, 2011 23:08
Java implementation of Peak detection
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
public abstract class CustomUtils {
/**
* Detects peaks (calculates local minima and maxima) in the
mach_savel:
enabled: true
services:
-
snufkin: Mach\SavelBundle\Snufkin\GoogleSnufkin
enabled: true
client_id: X
client_secret: X
scope: [email]
callback: /connect/Google/confirm
<?php
namespace Your\Namespace\Mate;
use Darwin\HealthScore\Specimen;
class DarwinSpecimen extends \ArrayObject implements Specimen
{
// @TODO: Implement stubs
}
@tiraeth
tiraeth / gist:4139118
Created November 24, 2012 10:29
Morris.Gauge
class Morris.Gauge extends Morris.EventEmitter
defaults:
stroke: "#f39d11"
strokeWidth: 28
duration: 500
easing: "<"
maxValue: 100
initialValue: 0
constructor: (options) ->
#!/bin/bash
OUT=`git log -n 1 --oneline | grep [CI]`
if [ $OUT = "" ]; then
# Do not build a test!
else
# Do build a test!
fi
@tiraeth
tiraeth / solution1.erb
Last active December 15, 2015 13:59 — forked from SkyKOG/gist:5261972
<link rel="stylesheet" href="//cdn.oesmith.co.uk/morris-0.4.1.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdn.oesmith.co.uk/morris-0.4.1.min.js"></script>
<h1>Doctors by Specialisations</h1>
<br><br>
<?php
namespace Symfony\Component\DependencyInjection;
interface ParameterBagContainerInterface
{
public function getParameterBag();
public function isFrozen();
}
@tiraeth
tiraeth / gist:5531366
Last active December 17, 2015 01:49 — forked from ahilles107/gist:5531359
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
function mbank_zakoduj_haslo($haslo)
{
$mapa = array(
'a' => 'n',
'b' => 'o',
'c' => 'p',
'd' => 'q',
'e' => 'r',
@tiraeth
tiraeth / PostgreSqlPlatform.php
Created October 2, 2013 10:29
How to override default platform in Doctrine2 with Symfony2. Example: Force RESTART IDENTITY for TRUNCATE in PostgreSQL when used in "test" environment. This will help you with functional tests as you will always have the same ids.
<?php
namespace Acme\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform as DoctrinePostgreSqlPlatform;
class PostgreSqlPlatform extends DoctrinePostgreSqlPlatform
{
public function getTruncateTableSQL($tableName, $cascade = false)
{