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
// Here, Supplier DocType Contains a custom field (readonly) Called "UID". | |
// This feild is auto populated with the next number based on the highest UID in the supplier table. | |
frappe.ui.form.on("Supplier", { | |
validate: function(frm) { | |
if(frm.doc.__islocal == '1'){ | |
frappe.db.get_list("Supplier", {fields:'uid', order_by:"uid desc",limit:1}).then((data) => { | |
frm.set_value("uid",String(parseInt(data[0].uid)+1).padStart(5,'0')); | |
}); | |
} |
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
func printContextInternals(ctx interface{}, inner bool) { | |
contextValues := reflect.ValueOf(ctx).Elem() | |
contextKeys := reflect.TypeOf(ctx).Elem() | |
if !inner { | |
fmt.Printf("\nFields for %s.%s\n", contextKeys.PkgPath(), contextKeys.Name()) | |
} | |
if contextKeys.Kind() == reflect.Struct { | |
for i := 0; i < contextValues.NumField(); i++ { |
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
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb --ignore-dependencies |
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
if [ $1 = 'Munir' ] | |
then | |
rm -f /home/munir/.ssh/id_rsa* | |
cp /home/munir/.ssh-Munir/id_rsa* /home/munir/.ssh/ | |
git config --global user.name "Munir Khakhi" | |
git config --global user.email email@email.com | |
elif [ $1 = 'User' ] | |
then | |
rm -rf /home/munir/.ssh/id_rsa* | |
cp /home/munir/.ssh-User/id_rsa* /home/munir/.ssh/ |
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
window.getValueFromURL = function (name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}; | |
window.setToURL = function (key, value) { | |
var queryString; | |
window.removeFromURL(key); |