Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View carry0987's full-sized avatar
:electron:

carry0987 carry0987

:electron:
View GitHub Profile
@carry0987
carry0987 / data.py
Created July 5, 2023 07:45 — forked from primaryobjects/data.py
LLM ChatGPT prompt engineering accuracy statistics. Using F-score and accuracy to measure effectiveness of prompts for classification. https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction
messages = [
{'content': 'I hate this food.', 'truth': 1},
{'content': 'This movie is terrible.', 'truth': 1},
{'content': 'I really like this play.', 'truth': 0},
{'content': 'I am just not sure.', 'truth': 0},
{'content': 'I can\'t believe you would do something like that!', 'truth': 1},
{'content': 'This is absolutely unacceptable!', 'truth': 1},
{'content': 'I am so angry right now, I can\'t even think straight.', 'truth': 1},
{'content': 'How could you be so thoughtless?', 'truth': 1},
{'content': 'You have no idea how much you\'ve hurt me.', 'truth': 1},
@carry0987
carry0987 / 1-setup.md
Created April 17, 2023 11:49 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@carry0987
carry0987 / signing-git-commits.md
Created April 17, 2023 11:49 — forked from phortuin/signing-git-commits.md
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
sleep-with-countdown() {
secs=$1
while [ $secs -gt 0 ]; do
printf "\rsleep: $secs\033[0K"
sleep 1
: $((secs--))
done
printf "\n"
}
@carry0987
carry0987 / hv_host.md
Created March 14, 2020 15:16
HV Host

HV Host List

Updated: 2019-09-29

Copy the belowing hosts into hosts file, and execute cmd, enter ipconfig/flushdns

213.227.140.199 alt.hentaiverse.org
104.20.27.25 e-hentai.org
104.20.26.25 e-hentai.org
104.20.134.21 g.e-hentai.org
104.20.135.21 g.e-hentai.org
@carry0987
carry0987 / Get-file-upload-progress-in-ajax-using-jquery.md
Last active January 23, 2020 14:34
Get File Upload Progress in Ajax using jQuery

Progress Bar helps to display the file upload status in real-time.
You can get the upload progress in Ajax and show the percentage progress bar using jQuery.
The progress bar is very useful to make the file upload process user-friendly.
The following code snippet shows how to get the file upload progress in Ajax and make a progress bar with percentage using jQuery.

  • Use xhr option in $.ajax() method to handle the progress bar operation.
  • Create a new XMLHttpRequest object using JavaScript window.XMLHttpRequest() method.
  • The progress event of XMLHttpRequest upload property allows to get the total and loaded length.
  • Calculate the percentage and handle the process bar.
<fieldset class="breadcrumb">
<span class="crumbs">
<span class="crust" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="{$base_url}" class="crumb" rel="up" itemprop="url">
<span class="crumb_img" itemprop="title">
<img class="breadcrumb_img" src="{$base_url}/static/icon/home.svg" alt="Home" />
</span>
</a>
</span>
</span>
@carry0987
carry0987 / Emmet-PHP.md
Last active May 12, 2019 03:39
Emmet-PHP

Emmet-PHP

How to expand abbreviations with Tab in other syntaxes

Emmet expands abbreviations in limited syntaxes only: HTML, CSS, LESS, SCSS, Stylus and PostCSS.
The reason to restrict Tab handler to a limited syntax list is because it breaks native Sublime Text snippets.
If you want to abbreviation with Tab in other syntaxes (for example, JSX, HAML etc.) you have to tweak your keyboard shorcuts settings:
add expand_abbreviation_by_tab command for tab key for required syntax scope selectors.
To get current syntax scope selector, press ⇧⌃P (OSX) or Ctrl+Alt+Shift+P, it will be displayed in editor status bar.

@carry0987
carry0987 / Diskpart.md
Created February 26, 2019 07:05
Diskpart

diskpart.txt

select disk 1
clean
convert gpt
create partition primary
assign letter=F
format fs=ntfs label=backup quick

Do

@carry0987
carry0987 / RPi3-Disable-Cron-Pam-Unix-Session.md
Last active August 17, 2018 12:34
RPi3-Disable-Cron-Pam-Unix-Session

RPi3 Disable Cron Pam_Unix Session

Step

  1. Use sudo vim /etc/pam.d/common-session-noninteractive to edit the settings

  2. Find this line

    session required pam_unix.so