Help!
Nobody can add two numbers.
We need an application wich accepts 2 numbers and adds them together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$iterator = new \RecursiveIteratorIterator( | |
new \RecursiveDirectoryIterator($dir), | |
\RecursiveIteratorIterator::SELF_FIRST | |
); | |
foreach ($iterator as $file) | |
if (!$file->isDir() && $file->getFilename() !== '.' && $file->getFilename() !== '..') { | |
$key = pathinfo($file->getPathName(), PATHINFO_DIRNAME); | |
if (!isset($data[$key])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('vendor/autoload.php'); | |
use TFarla\Routing\Router; | |
use TFarla\Routing\Route; | |
$router = new Router([ | |
new Route('show user', '^/users/(?P<id>\d+)/$', ['GET'], function($matches) { | |
return $matches['id']; | |
}), | |
new Route('list users', '^/users/$', ['GET'], function($matches) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class UserRole { | |
const Admin = 'Admin'; | |
private function __construct() { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app').controller(['$meteor, $scope', function() { | |
$scores = $meteor.collection(Scores).subscribe('scores'); | |
$scope.amount = ''; | |
$scope.insertScore = function() { | |
$scores.call('insertScore', $scope.amount); | |
} | |
$scope.resetAmount = function() { | |
$scope.amount = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addOne(number, times, iterated) { | |
iterated = iterated || 0; | |
return iterated == times ? number : addOne(number + 1, times, iterated + 1); | |
} | |
addOne(1, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Container() { | |
this.objects = {}; | |
} | |
Container.prototype.register = function (name, object) { | |
return this.objects[name] = object; | |
}; | |
Container.prototype.get = function (name) { | |
return this.objects[name]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dom-module id="github-card"> | |
<style> | |
</style> | |
<template> | |
<iron-ajax | |
id="getCard" | |
handle-as="json" | |
on-response="handleResponse"> | |
</iron-ajax> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
... | |
<link rel="import" href="pomodoro-clock.html"> | |
<link rel="import" href="pomodoro-timer.html"> | |
</head> | |
<body> | |
<pomodoro-clock work-seconds="25" break-seconds="5"></pomodoro-clock> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tasks = new Mongo.Collection('tasks'); | |
if (Meteor.isServer) { | |
Tasks.insert({ | |
text: 'hey' | |
}); | |
Meteor.publish('tasks', function () { | |
console.log('connected'); | |
var tasks = Tasks.find().fetch(); | |
console.log(tasks); |
OlderNewer