Skip to content

Instantly share code, notes, and snippets.

View ohmydevops's full-sized avatar
🚵‍♀️

Amirhossein Baghaie ohmydevops

🚵‍♀️
View GitHub Profile
#! /bin/bash
# clear screen!
clear
# change Time zone to tehran in current process
TZ=Asia/Tehran
# ask for gitea backup directory on your machine
echo -n "Enter gitea backup full path (example: /var/log/gitea/): "
@ohmydevops
ohmydevops / docker.txt
Last active July 14, 2019 21:01
docker cheat sheet
docker build -t myimagename .
docker run -p 4000:80 myimagename
docker run -d -p 4000:80 myimagename
docker exec -it [container-id] bash
docker ps
docker stop <hash>
docker ps -a
docker kill <hash>
docker rm <hash>
docker rm $(docker ps -a -q)
#!/bin/bash
# تعریف متغیرهایی که نیاز داریم
nextYear=1398
months=(
'فروردین'
'اردیبهشت'
'خرداد'
'تیر'
'مرداد'
@ohmydevops
ohmydevops / app.js
Created January 22, 2019 17:12
handel back button
$(window).on('previous', function (e) {
e.preventDefault();
var stop = false;
var width = document.getElementById("mySidenav").style.width;
$('.modal').each(function () {
if ($(this).hasClass('show')) {
$(this).modal('hide');
stop = true;
}
alias xampp-start="sudo /opt/lampp/lampp start"
alias xampp-stop="sudo /opt/lampp/lampp stop"
alias xampp-status="sudo /opt/lampp/lampp status"
@ohmydevops
ohmydevops / reset.txt
Created June 11, 2018 03:41
Css Reset File
https://jgthms.com/minireset.css/
@ohmydevops
ohmydevops / html
Last active May 20, 2018 21:33
our base file in html for course (day2 - sadjadiofrontend101)
<!doctype html>
<html lang="fa">
<head>
<meta charset="utf-8">
<title>Title</title>
<meta name="description" content="Sadjad I/O Front-end Development Course">
<meta name="author" content="@amirbagh75">
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
@ohmydevops
ohmydevops / app.html
Last active May 19, 2018 16:05
how browsers render HTML/CSS ? (day1 - sadjadiofrontend101)
<html>
<head>
<title>title is here</title>
</head>
<body>
<button onclick="test()" style="width:100px; height:100px;">click here</button>
</body>
<script>
function test(){
alert("clicked!")
@ohmydevops
ohmydevops / editors
Last active May 17, 2018 09:56
Fornt-End Editors
- vscode
- atom
- notepad
- notepad ++
- gedit
- Sublime Text
- Brackets
@ohmydevops
ohmydevops / instagram_scrape.php
Created March 8, 2017 09:16 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}