Skip to content

Instantly share code, notes, and snippets.

View M-Razavi's full-sized avatar
🏹
Focusing

Mahdi Razavi M-Razavi

🏹
Focusing
View GitHub Profile
@M-Razavi
M-Razavi / gist:ea9f79eeae6add5b9746f71e6468d111
Created November 29, 2018 12:38
send email from linux shell
mail -s "Subject" -A attach.html [email protected] < messageBodyFile
mail -s "Subject" -A attach.html [email protected] < /dev/null
travis setup releases --pro --force
@M-Razavi
M-Razavi / gist:6818b7d3285ddf4cd0a24054f72e4112
Created June 7, 2019 15:53 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
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
@M-Razavi
M-Razavi / AboutMe.gif
Last active May 3, 2024 09:00 — forked from wgcv/AboutMe.gif
About Me
AboutMe.gif
@M-Razavi
M-Razavi / MeduimPost_Anotations.csv
Last active June 22, 2019 05:36
MeduimPost_Anotations
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}
#!/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
@M-Razavi
M-Razavi / sbt-utilities
Created June 24, 2019 13:30 — forked from joesan/sbt-utilities
Ignore Tests when Running SBT
sbt 'set test in Test := {}' clean assembly
; 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:
@M-Razavi
M-Razavi / getCompileTime.java
Created July 10, 2019 05:45
Java print time of last compilation
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");
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+