Skip to content

Instantly share code, notes, and snippets.

View Cvetomird91's full-sized avatar

Cvetomir Denchev Cvetomird91

  • Plovdiv, Bulgaria
View GitHub Profile
<?php
$array1 = array(1, 2, 3, 4, 5);
$array2 = array(6,7,8,9);
$arrays_total_length = count($array1) + count($array2);
$index1 = 0;
$index2 = 0;
$output_array = array();
<?php
class ArraySearch
{
public static $occurences = 0;
public static function countItems($arr, $item)
{
foreach ($arr as $key => $value) {
if (is_array($value)) {
ArraySearch::countItems($value, $item);
#include <iostream>
using namespace std;
template <typename T1, typename T2>
int* concatArrays( T1& array_1, T2& array_2) {
int arrayCount_1 = sizeof(array_1) / sizeof(array_1[0]);
int arrayCount_2 = sizeof(array_2) / sizeof(array_2[0]);
int newArraySize = arrayCount_1 + arrayCount_2;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Problem</title>
<script>
window.addEventListener('load', function(event) {
var form = document.getElementById('uploader');
var file_upload = document.getElementById('file_upload');
#!/usr/bin/env bash
#this is the Lonely Integer challenge from HackerRank
declare -a numbers;
control_string="%d\\n";
read count || [ -n "$count" ];
while read number || [ -n "$number" ]; do
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$temp = '';
$word = lcfirst($word);
$length = strlen($word);
<?php
//solution for Test Dome PHP File Owner Task
class FileOwners
{
public static function groupByOwners($files)
{
$owners = array_unique($files);
<?php
//the Thesaurus PHP task from Test Dome
class Thesaurus
{
private $thesaurus;
function Thesaurus($thesaurus)
{
find - the find utility
Options
- without arguements - lists all files in current and child directories
-type - filetype
d - directory
b - block device
f - file
p - named pipe (FIFO)
curl
curlrc configs:
progress-bar - display progress bar
curl -I - returns HTTP response headers
curl -s - silent mode - don't show progress level or error messages
curl -X - specify HTTP Method (HEAD, POST, GET, PUT or DELETE)
curl -H - add HTTP Request header