This file contains 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 | |
<#assign licenseFirst = "/* "> | |
<#assign licensePrefix = " * "> | |
<#assign licenseLast = " */"> | |
<#include "${project.licensePath}"> | |
<#if namespace?? && namespace?length > 0> | |
<#assign strings = namespace?split("\\")> | |
<#assign package = strings[0]> | |
<#assign category = namespace?substring(namespace?index_of("\\") + 1)> |
This file contains 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
#!/bin/sh | |
bundle=$1 | |
entity=$2 | |
php app/console doctrine:mapping:import --filter=$entity $bundle xml | |
php app/console doctrine:mapping:convert --force --filter=$entity annotation ./src | |
php app/console doctrine:generate:entities $bundle:$entity |
This file contains 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 | |
//Based on http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/ | |
class hex2rgb { | |
private static $_cache = array(); | |
private function __construct() { | |
} |
This file contains 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
@echo off | |
set __SOURCE_PATH=%~dp0 | |
set __SOURCE_PATH=%__SOURCE_PATH:~0,-1% | |
for /f %%i in ('where vcpkg.exe') do ( | |
set __SCRIPT_PATH=%%~dpiscripts | |
goto :script_found | |
) | |
echo Could not find executable: vcpkg.exe |
This file contains 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
/** | |
This should transform the string: | |
- name=Maria, grades-90,age/25?university-UCL,surname=Hill,grades//85,graduates=5%ID=356231, graduates-7,grades=78//graduates=3 | |
Into: | |
{ | |
"output":{ | |
"university":"UCL", | |
"students":{ | |
"name":"Maria", |
This file contains 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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <regex> | |
auto match_all(std::string input, const std::string& pattern) noexcept { | |
std::vector<std::pair<std::string, int>> matches{}; | |
try { | |
const std::regex self_regex(pattern);//, std::regex_constants::ECMAScript | std::regex_constants::icase); |
This file contains 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 | |
//https://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/ | |
function swap(string &$str, int $i, int $ii) : void { | |
$tmp = $str[$i]; | |
$str[$i] = $str[$ii]; | |
$str[$ii] = $tmp; | |
} | |
function permute(string $str, int $l, int $r, array &$result) : void { |
This file contains 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 | |
class Pappi { | |
private $prop = "default value"; | |
} | |
class Child extends Pappi { |
This file contains 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
#include <iostream> | |
#include <unordered_map> | |
#include <string> | |
template <typename T1, typename T2> | |
std::unordered_map<T2, T1> flip(std::unordered_map<T1, T2>& m) { | |
std::unordered_map<T2, T1> result; | |
for (auto&& [key, value] : m) { | |
result.emplace(value, key); |
This file contains 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
tail -f -v logdir/*.log | sed -E 's/([^\n]#[0-9]+\s)/\n\1/g' |
OlderNewer