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
  • 16:09 (UTC +02:00)
View GitHub Profile
@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: '='
// 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!"
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)
@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
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 / 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;
@Tjorriemorrie
Tjorriemorrie / .htaccess
Created March 7, 2014 08:17
Symfony2 shared hosting htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
@Tjorriemorrie
Tjorriemorrie / test.py
Created July 14, 2014 14:10
POC for forex using RF
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
from sklearn.ensemble import RandomForestRegressor
from sklearn.cross_validation import cross_val_score
import sklearn as sk
df = pd.read_csv(
@Tjorriemorrie
Tjorriemorrie / main.py
Created April 18, 2015 10:13
Does not work
import argparse
import random
from os import path
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Entelect Challenge Python Bot Player', epilog='Good luck!')
parser.add_argument('output_path', help='the output path where files will be saved')
args = parser.parse_args()
if not path.exists(args.output_path):
// 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!"