Skip to content

Instantly share code, notes, and snippets.

View Tjorriemorrie's full-sized avatar
💭
most repos are private

Tjorriemorrie Tjorriemorrie

💭
most repos are private
  • South Africa
  • 12:33 (UTC +02:00)
View GitHub Profile
@Tjorriemorrie
Tjorriemorrie / JsonSerializerListener.php
Created March 6, 2014 12:38
Listener for JMS Serializer
<?php
namespace Talentec\MainBundle\Listener;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Doctrine\Common\Annotations\Reader;
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
$range = range(1, 100);
array_walk($range, function($num) {
$val = '';
if (!($num % 3)) {
$val = 'Fizz';
}
if (!($num % 5)) {
$val .= 'Buzz';
@Tjorriemorrie
Tjorriemorrie / 01-00-00.net
Created November 1, 2013 10:40
fann error on loading this file
FANN_FLO_2.1
num_layers=3
learning_rate=0.900000
connection_rate=1.000000
network_type=0
learning_momentum=0.000000
training_algorithm=2
train_error_function=1
train_stop_function=0
cascade_output_change_fraction=0.010000
angular.module('ymusica').controller('AlbumSearch', ['$scope', 'Albums', 'Artists', '$q', function($scope, albums, artists, $q) {
$scope.albums = [];
$scope.artists = [];
var terms = new Rx.Subject();
$scope.searchMusic = terms.onNext.bind(terms);
terms.sample(250)
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@Tjorriemorrie
Tjorriemorrie / directives.js
Last active December 21, 2015 10:39
bootstrap 3 datetimepicker directive
'use strict'
angular.module('directives', [])
.directive('dateTimePicker', function() {
return {
restrict: 'E',
require: ['ngModel'],
scope: {
ngModel: '='