Skip to content

Instantly share code, notes, and snippets.

@compustar
compustar / prompt_gemini.txt
Last active May 1, 2024 18:51
Prompt collection of different chat agent
**You are a friendly and helpful assistant.**
* Ensure your answers are complete unless the user requests a more concise approach.
* When generating code, offer explanations for code segments as necessary and maintain good coding practices.
* When presented with inquiries seeking information, provide answers that reflect a deep understanding of the field, guaranteeing their correctness.
* For any non-english queries, respond in the same language as the prompt unless otherwise specified by the user.
* For prompts involving reasoning, provide a clear explanation of each step in the reasoning process before presenting the final answer.
**Additionally, you are to:**
Sample for reference only
Copyright © 2001 Hong Kong Institute of Human Resource Management. All rights reserved.
@compustar
compustar / employee_handbook_qna_gpt3.ipynb
Last active January 26, 2023 05:17
employee_handbook_qna_gpt3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@compustar
compustar / Dockerfile.appd_jdk6
Created August 25, 2022 19:14
TLS Bumping for Java 6 AppDynamics Agent Instrumentation with NGINX
FROM yannart/jboss-5.1.0.ga-jdk6
# Download the agent and configure the controller-info.xml BEFORE building the image
COPY AppServerAgent /opt/appdynamics
ENV JAVA_TOOL_OPTIONS=-javaagent:/opt/appdynamics/javaagent.jar
@compustar
compustar / Dockerfile
Created August 18, 2022 15:31
AppDynamics Agent Instrumentation for Java 6
FROM yannart/jboss-5.1.0.ga-jdk6
# Download the agent and configure the controller-info.xml BEFORE building the image
COPY AppServerAgent /opt/appdynamics
# INSTRUCTION REFERENCE: https://stackoverflow.com/questions/33364100/how-to-use-tls-1-2-in-java-6
# Update Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6
RUN wget --continue --no-check-certificate --header "Cookie: oraclelicense=a" "https://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip" && \
unzip jce_policy-6.zip && \
@compustar
compustar / Unpivot.vb
Created February 16, 2020 19:34
Unpivoting Statistics on Passenger Traffic at https://www.immd.gov.hk/eng/message_from_us/stat.html
Sub Unpivot()
'
' Macro1 Macro
'
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C5").Select
Selection.Copy
Columns("D:D").Select
@compustar
compustar / CleanWikiCovid.vb
Last active March 13, 2020 03:44
VBA macro to preprocess 2019 nCoV data
Sub CleanWikiCovid()
Selection.Hyperlinks.Delete
Selection.UnMerge
Range("A1").Select
Cells.Find(What:="date", After:=ActiveCell, LookIn:=xlFormulas2, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
While Selection.Column > 1
Selection.EntireColumn.Delete
@compustar
compustar / parse_gmap_json.py
Last active February 9, 2020 07:39
Python script parses Google Map JSON and convert it to Excel parsable JSON
import json
def get_layers(data):
return data[1][6]
def get_items(data):
return data[12][0][13][0]
def parse_item(item):
output = {"latitude": item[1][0][0][0],
@compustar
compustar / MergeWorksheets.vb
Created February 1, 2020 09:34
VBA to merge Excel Worksheets
Sub Macro3()
'
' Macro3 Macro
'
newSheetName = "MergedSheet"
On Error Resume Next
Sheets(newSheetName).Select
If ActiveSheet.Name <> newSheetName Then
@compustar
compustar / NumberAsText.vb
Created December 31, 2019 06:42
Convert numbers to words for check/cheque printing
'
' A VBA macro to convert numbers to words for check/cheque printing
'
' Credit to Rick Rothstein (https://answers.microsoft.com/en-us/profile/1479b918-5537-45b1-a709-6c4bae9d7da4)
' Original reference: https://answers.microsoft.com/en-us/office/forum/office_2003-excel/convert-numers-to-words-for-checkcheque-printing/5a88ab46-4211-464f-8358-d196408f3ea5
'
' A1: 123.45
' In B1:
' =NumberAsText(A1) ==> One Hundred Twenty Three Point Four Five
' =NumberAsText(A1,"And") ==> One Hundred and Twenty Three Point Four Five