Discover gists
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
/* Some test definition here */ | |
#define DEFINED_BUT_NO_VALUE | |
#define DEFINED_INT 3 | |
#define DEFINED_STR "ABC" | |
/* definition to expand macro then apply to pragma message */ | |
#define VALUE_TO_STRING(x) #x | |
#define VALUE(x) VALUE_TO_STRING(x) | |
#define VAR_NAME_VALUE(var) #var "=" VALUE(var) |
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
On (Lasts for 10 seconds): | |
hidapitester.exe --vidpid 340D/1710 --open --length 10 --send-output 0x0,0xFF,0x01,0x66,0xC8,0xFF,0xAD,0x52,0x81,0xD6 | |
Off: | |
hidapitester.exe --vidpid 340D/1710 --open --length 10 --send-output 0x0,0xFF,0x00,0x00,0x64,0x00,0x32,0x9E,0xD7,0x0D | |
Address: VID and PID (Vendor ID and Product ID) |
NOTICE: This guide will help you set ssh keys for GitHub and GitLab. However, this is not going to change your commit
user.name
oruser.email
. If you need to change those for specific repositories, just run the following commands while in your repository:
git config user.name "Your Name Here"
git config user.email your@email.com
For more info, see this answer. Also, keep in mind this only changes the
.git
folder inside your repository which never gets added/committed/pushed/uploaded.
I recently had to manage two ssh keys (one for Github and one for Gitlab). I did some research to find the best solution. I am justing putting the pieces together here.
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
def lambda_handler(event, context): | |
import subprocess | |
result = subprocess.call("curl -I http://foo.bar", shell=True) | |
return result | |
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
# See https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/ | |
# 8.0-preview-alpine works too | |
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build | |
ARG TARGETARCH | |
WORKDIR /source | |
# copy csproj and restore as distinct layers | |
COPY *.csproj . | |
RUN dotnet restore -a $TARGETARCH |
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
Windows Registry Editor Version 5.00 | |
; 7-Zip Windows 11 Context Menu entries via whitelisted id reuse example by AveYo | |
; Add to archive.. only single files (multiple would need a single instance redirect tool) | |
[-HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\connectNetworkDrive] | |
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\connectNetworkDrive] | |
"MuiVerb"="@C:\\Program Files\\7-Zip\\7-zip.dll,-2324" | |
"Position"="Middle" | |
"Icon"="C:\\Program Files\\7-Zip\\7-zip.dll,0" |
People
:bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
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
(defun min-bib (mainbbl origbib destbib) | |
(interactive "fMain .bbl file: \nfOriginal .bib file: \nFDestination .bib file (will be overwritten): \n") | |
(let ((matches) | |
(dest-buffer (find-file-noselect destbib))) | |
(with-current-buffer (find-file-noselect mainbbl) | |
(goto-char 1) | |
(while (search-forward-regexp "\\\\bibitem{\\(.*?\\)}" nil t 1) | |
(push (match-string-no-properties 1) matches))) | |
(with-current-buffer dest-buffer (erase-buffer)) | |
(with-current-buffer (find-file-noselect origbib) |
NewerOlder