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
public class Search { | |
public void binarySearch(int find, List<Integer> ds){ // Use when the data is sorted only | |
int first = 0, mid, last=ds.size()-1; | |
int count = 0; | |
while (true){ | |
count++; | |
mid = first + (last - first)/2; | |
if (find > ds.get(mid)) | |
first = mid+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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.HashSet; | |
/** | |
* Created on 11/30/17 | |
* | |
* @author <a href="mailto:[email protected]">Ammar Al-khawaldeh</a> | |
*/ |
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
function dce() | |
{ | |
docker-compose exec "$1" bash | |
} | |
function _dce() | |
{ | |
services=$(docker-compose config --services 2>/dev/null) | |
if [ -z $services ]; then |
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 | |
# Problem 2: | |
# Function: | |
function listFramer(array $list): string { | |
$longestWord = 0; | |
foreach($list as $item) | |
if(($itemLength = strlen($item)) > $longestWord) | |
$longestWord = $itemLength; |
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 | |
# Problem 2: | |
# Function: | |
function mergeSortedSequences(array $list1, array $list2) : array { | |
$l1pointer = 0; | |
$l2pointer = 0; | |
$result = []; | |
while ($l1pointer < count($list1) && $l2pointer < count($list2)) { |
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 | |
# Problem 1: | |
# Functions: | |
function previousPosition(int $current, int $shift, int $length) { | |
return ($amount = $current - $shift) < 0 ? $length + $amount : $amount; | |
} | |
function rotatePrevious(array $list, int $shift, $startFrom, $replaceWith, $startRoot) { |
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
function changeTab(tabName) { | |
$('.tabstest .pmtab').removeClass('active'); | |
$('.tabcontent').removeClass('active'); | |
$('.tabstest .pmtab[data-tab='+ tabName + ']').addClass('active'); | |
$("#"+tabName).addClass('active'); | |
localStorage.setItem('current', tabName); | |
} | |
$(document).ready(function(){ | |
var current = localStorage.getItem('current'); |
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/bash | |
tmux new-session -d -s mySession -n myWindow | |
tmux send-keys -t mySession:myWindow "ssh $1" Enter | |
shift | |
for var in "$@" | |
do | |
tmux split-window -h | |
tmux send-keys -t mySession:myWindow "ssh ${var}" Enter |
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
<script type="text/ecmascript"> | |
import _ from 'lodash'; | |
import moment from 'moment'; | |
export default { | |
props: ['value', 'options', 'optionId', 'optionText'], | |
data() { | |
return { | |
searchTerm: '', |
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
name: Deployment | |
run-name: Deployment | |
on: | |
push: | |
branches: | |
- 'master' # انا مهتم بالرفع فقط عند دمج أي شيء على الفرع الرئيسي | |
jobs: | |
stage: | |
runs-on: ubuntu-latest |
OlderNewer