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
mail -s "Subject" -A attach.html [email protected] < messageBodyFile | |
mail -s "Subject" -A attach.html [email protected] < /dev/null |
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
travis setup releases --pro --force |
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
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | 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
Framework | Path segment | http query parameter | |
---|---|---|---|
Jersey (JAX-RS) | @PathParam | @QueryParam | |
Spring RESTFul | @PathVariable | @RequestParam | |
example | http://xyz.ir/{segment} | http://xyz.ir/?param{param} |
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 | |
#algorithm from jdf project(a calender convertor for php.) | |
#day,month,year and other english var used for miladi and sal mah rooz and ... used for jalali. | |
#-h (help) -f(farsi) -d(special date) -s (spliter character) and without option we use finglish and print curent date. | |
#default spliter(delimiter) character is "-" | |
#although -s suport string but recomended using a character. | |
date=$(date "+%Y-%m-%d") #set default date |
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
sbt 'set test in Test := {}' clean assembly |
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
; commands separated by a ; are executed sequentially. The shell waits for each command to terminate in turn. | |
&& command after && is executed if, and only if, command before && returns an exit status of zero. You can think of it as AND operator. | |
| a pipe. In expression command1 | command2 The standard output of command1 is connected via a pipe to the standard input of command2. | |
There are more similar control operators, worth to mention: |
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
private static final Date buildDate = getClassBuildTime(); | |
/** | |
* Handles files, jar entries, and deployed jar entries in a zip file (EAR). | |
* @return The date if it can be determined, or null if not. | |
*/ | |
private static Date getClassBuildTime() { | |
Date d = null; | |
Class<?> currentClass = new Object() {}.getClass().getEnclosingClass(); | |
URL resource = currentClass.getResource(currentClass.getSimpleName() + ".class"); |
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
UBUNTU: | |
SSD: | |
sudo apt install nvme-cli | |
sudo nvme smart-log /dev/nvme0 | |
# check percentage_used % | |
Memory: | |
1-Turn On or Restart the system | |
2-Hold down Shift to bring up the GRUB menu. | |
3-Use the arrow keys to move to the entry labeled Ubuntu, memtest86+ |
OlderNewer