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
# send_email "recipient@example.com" "Subject Here" "Email content here" | |
function send_email() { | |
local email_address=$1 | |
local subject=$2 | |
local content=$3 | |
echo -e "$content" | mail -s "$subject" "$email_address" | |
} |
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
---- Menu Look-up | |
SELECT SRCH.PORTAL_LABEL LABEL | |
, NVL(SRCH.PORTAL_URI_SEG2, ' ') COMPNOENT | |
, SRCH.PORTAL_OBJNAME | |
--L1.PORTAL_LABEL, L2.PORTAL_LABEL, L3.PORTAL_LABEL, | |
--L4.PORTAL_LABEL, L5.PORTAL_LABEL, L6.PORTAL_LABEL | |
,'Main Menu > ' || L1.PORTAL_LABEL || decode(L1.PORTAL_REFTYPE, 'F', ' > ') | |
|| L2.PORTAL_LABEL || DECODE(L2.PORTAL_REFTYPE, 'F', ' > ') | |
|| L3.PORTAL_LABEL || DECODE(L3.PORTAL_REFTYPE, 'F', ' > ') | |
|| L4.PORTAL_LABEL || DECODE(L4.PORTAL_REFTYPE, 'F', ' > ') |
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
import sqlparse | |
def extract_sql_info(sql_query): | |
# Parse the SQL query | |
parsed_query = sqlparse.parse(sql_query)[0] | |
# Extract table names | |
tables = [] | |
for token in parsed_query.tokens: | |
if isinstance(token, sqlparse.sql.Identifier): |
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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <image_file>" | |
exit 1 | |
fi | |
image_file="$1" | |
convert "$image_file" -resize 128x128 128.png |
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
import xml.dom.minidom | |
def format_xml(input_file, output_file): | |
# Parse the input XML file | |
doc = xml.dom.minidom.parse(input_file) | |
# Pretty print the XML document | |
pretty_xml = doc.toprettyxml(indent=" ") | |
# Save the formatted XML to the output file |
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
import csv | |
import json | |
def convert_csv_to_json(csv_file_path, json_file_path): | |
data = [] | |
with open(csv_file_path, 'r') as csv_file: | |
csv_reader = csv.DictReader(csv_file) | |
for row in csv_reader: | |
data.append(row) |
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
import csv | |
def convert_csv_to_markdown(csv_file_path, output_file_path): | |
table = [] | |
with open(csv_file_path, 'r') as csv_file: | |
csv_reader = csv.reader(csv_file) | |
for row in csv_reader: | |
table.append(row) | |
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
$(function(){ | |
$('a[href="#"]').click(function () { | |
return false | |
}); | |
}); |
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
console.print = function (...args) { | |
queueMicrotask (console.log.bind (console, ...args)); | |
} |
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
import json | |
# Open the JSON file for reading | |
with open('input.json', 'r') as f: | |
# Load the JSON data into a Python dictionary | |
data = json.load(f) | |
# Open a new file for writing | |
with open('output.json', 'w') as f: | |
# Write the pretty printed JSON data to the output file |
NewerOlder