Skip to content

Instantly share code, notes, and snippets.

@samanzamani
samanzamani / database-backup.sh
Created August 6, 2020 09:14
auto generate back up from all available databases and sites
#!/bin/bash
#----------------------------------------
# OPTIONS
#----------------------------------------
USER='' # MySQL User
PASSWORD='' # MySQL Password
DAYS_TO_KEEP=60 # 0 to keep forever
GZIP=1 # 1 = Compress
BACKUP_PATH='/var/backup-sites/databases'
#----------------------------------------
include: all_lint_rules.yaml
analyzer:
exclude:
- "lib/core/model/g/*.g.dart"
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
# We explicitly enabled even conflicting rules and are fixing the conflict
@samanzamani
samanzamani / saman-theme.zsh
Last active April 17, 2020 06:17
saman power9k theme setting
POWERLEVEL9K_MODE="nerdfont-complete"
POWERLEVEL9K_DISABLE_RPROMPT=false
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ "
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_elementary_icon dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(host time os_icon)
@samanzamani
samanzamani / saman.zsh
Created April 12, 2020 12:12
my custom oh my zsh file
alias art="php artisan"
alias saman="tmux att -t Saman"
alias reap="sudo systemctl restart apache2"
@samanzamani
samanzamani / gist:7ab3046ae1f94348d852bde959349f92
Last active April 23, 2024 14:27
لیست کامل تمام شهرها و استان های ایران
[
{
"province": "اردبیل",
"cities": [
"اردبیل",
"اصلاندوز",
"آبی بیگلو",
"بیله سوار",
"پارس آباد",
"تازه کند",
void main() {
var num = 1.6176;
print((num*1000).ceil()/1000);
}
void main() {
var num = 1.6176;
print((num*1000).ceil()/1000);
}
@samanzamani
samanzamani / ClassTest.dart
Created March 21, 2019 10:03
Sample class and function in Dart
class MyClass{
String str = '';
MyClass(this.str);
}
void main() {
MyClass obj1 = MyClass('obj1 initial');
print(obj1.str);