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
| @java.lang.FunctionalInterface | |
| interface Math | |
| { | |
| public int calc(int a, int b); | |
| } | |
| public class LambdaExample | |
| { | |
| public static void main(String[] args) { | |
| // define your function |
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 jsonDummy = { | |
| key: 'val', | |
| underobj: { | |
| ewssswww: undefined, | |
| asdas: 45105, | |
| ssswww: undefined, | |
| errwew: undefined, | |
| ssswww: 0, | |
| sdfsd: 'dfsdf', | |
| uuunt: { |
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 | |
| /* | |
| > composer install | |
| # encript: | |
| php _encript-decript-from-console.php enc "password" file.pdf | |
| => result = timestamp-file.pdf.enc | |
| php _encript-decript-from-console.php enc "password" image.jpg | |
| => result = timestamp-mage.jpg.enc | |
| php _encript-decript-from-console.php enc "password" folderA |
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 | |
| $arr1 = array( | |
| "a" => ["x", "d" => "override me..", "d2" => ["q"], "v" => "NOT-IN-B"], | |
| "b" => ["d" => 155, "fff" => ["aa"=>551]], | |
| 5, 8, 9 | |
| ); | |
| $arr2 = array( | |
| "a" => ["v", "d" => "overrided!", "qq" => "ONLY-IN-B"], |
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
| // remove utf-8 BOM from ressource "res" | |
| // res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279 | |
| if (res.charCodeAt(0) === 0xFEFF) { | |
| res = res.substr(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
| var text = ""; | |
| var alphabet = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,w,x,y,z".split(","); | |
| var wordCount = 256; | |
| for(var i=0; i<wordCount; i++) { | |
| var rand = null; | |
| for (var x=0; x<7; x++) { | |
| rand = Math.floor(Math.random() * alphabet.length); | |
| text += alphabet[rand]; | |
| } | |
| if (i<wordCount-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
| function isEven(number) { | |
| return !(number & 1); | |
| } | |
| function isOdd(number) { | |
| return !!(number & 1); | |
| } | |
| isOdd(5); // true |
NewerOlder