Skip to content

Instantly share code, notes, and snippets.

View ahmadidev's full-sized avatar

Ahmad Ahmadi ahmadidev

View GitHub Profile
@ahmadidev
ahmadidev / containers-and-resources.sh
Last active May 2, 2022 16:08
Get all containers in all namespaces with resources using jsonpath
kubectl get pod -o jsonpath="{range .items[*]}{'Namespace: '}{.metadata.namespace}{range .spec.containers[*]}{' Container:
'}{.name}{' Resources: '}{.resources}{'\n'}{end}{end}" -A
@ahmadidev
ahmadidev / ReplaceEnglishNumbersWithPersian.js
Created December 15, 2015 11:19
Replacing English numbers with Persian characters
var persianNumbers = [ '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' ];
var getPersianNumbers = function(str) {
return ('' + str).replace(/(\d)/g, function(x) { return persianNumbers[x]; });
};
["Hamid shared a document with you.","New signin from firefox on windows","Ahmad left a comment on your GajInbox project","Make sure this works fine."]
@ahmadidev
ahmadidev / foxitreader.desktop
Last active February 19, 2021 16:42
ubuntu Foxit reader desktop - foxitreader.desktop
[Desktop Entry]
Name=Foxit Reader
Comment=Foxit Reader
GenericName=Foxit Reader
Keywords=PDF;Reader
Exec=/opt/FoxitReader/FoxitReader %U
Terminal=false
Type=Application
Icon=/opt/FoxitReader/Foxit_Reader_Logo.png
Categories=GNOME;GTK;Reader;
<?php
function addItem($itemValue)
{
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "test";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);