Skip to content

Instantly share code, notes, and snippets.

View tulik's full-sized avatar
:octocat:
Kubernetes!

Lukasz D. Tulikowski tulik

:octocat:
Kubernetes!
View GitHub Profile
<?php
namespace AppBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use AppBundle\Entity\Items;
use Symfony\Component\HttpFoundation\Response;
class TagsController extends Controller
@tulik
tulik / .htaccess
Created May 18, 2017 12:36
Symfony: htaccess to hide app.php or app_dev.php
DirectoryIndex app.php
#DirectoryIndex app_dev.php
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect to URI without front controller to prevent duplicate content
# (with and without `/app.php`). Only do this redirect on the initial
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
# endless redirect loop (request -> rewrite to front controller ->
<?php
function array_diff_assoc_recursive($array1, $array2)
{
$difference = array();
foreach ($array1 as $key => $value) {
if (is_array($value)) {
if (!isset($array2[$key]) || !is_array($array2[$key])) {
$difference[$key] = $value;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ngx_restangular_module_1 = require("./ngx-restangular.module");
exports.RestangularModule = ngx_restangular_module_1.RestangularModule;
var ngx_restangular_1 = require("./ngx-restangular");
exports.Restangular = ngx_restangular_1.Restangular;
var ngx_restangular_http_1 = require("./ngx-restangular-http");
exports.RestangularHttp = ngx_restangular_http_1.RestangularHttp;
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var http_1 = require("@angular/http");
var rxjs_1 = require("rxjs");
var ngx_restangular_helper_1 = require("./ngx-restangular-helper");
var RestangularHttp = (function () {
function RestangularHttp(http) {
this.http = http;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var rxjs_1 = require("rxjs");
var _ = require("./lodash");
var ngx_restangular_config_1 = require("./ngx-restangular.config");
var ngx_restangular_http_1 = require("./ngx-restangular-http");
var ngx_restangular_config_factory_1 = require("./ngx-restangular-config.factory");
var Restangular = (function () {
function Restangular(configObj, injector, http) {
public function vendors(): Collection
{
return $this->belongsToMany(Vendor::class);
}
public function index(): Response
{
$products = Product::with('vendors')->get();
if (!$products) {
'use strict';
function run(callback) {
main(bench, v8_mute, callback);
main(bench, if_func_1, callback);
main(bench, if_func_2, callback);
main(bench, if_func_3, callback);
}
function main(bench, func) {
package main
import (
"fmt"
"time"
)
func main() {
bench(if_func_1)
bench(if_func_2)
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void bench(void (*f)(int));
void if_func_1(int i);
void if_func_2(int i);
void if_func_3(int i);
int main() {