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 | |
$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(); |
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 ArraySearch | |
{ | |
public static $occurences = 0; | |
public static function countItems($arr, $item) | |
{ | |
foreach ($arr as $key => $value) { | |
if (is_array($value)) { | |
ArraySearch::countItems($value, $item); |
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> | |
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; |
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
<!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'); |
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
#!/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 |
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 Palindrome | |
{ | |
public static function isPalindrome($word) | |
{ | |
$temp = ''; | |
$word = lcfirst($word); | |
$length = strlen($word); |
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 | |
//solution for Test Dome PHP File Owner Task | |
class FileOwners | |
{ | |
public static function groupByOwners($files) | |
{ | |
$owners = array_unique($files); |
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 | |
//the Thesaurus PHP task from Test Dome | |
class Thesaurus | |
{ | |
private $thesaurus; | |
function Thesaurus($thesaurus) | |
{ |
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
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) |
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
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 |
OlderNewer