This file contains hidden or 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
| #cloud-config | |
| packages: | |
| - fail2ban | |
| - ufw | |
| - unattended-upgrades | |
| package_update: true | |
| package_upgrade: true | |
| users: | |
| - name: admin | |
| groups: |
This file contains hidden or 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
| Porridge recipe | |
| A great way to start the day! | |
| Ingredients: | |
| Oats | |
| Milk (Dairy or non-dairy) | |
| Instructions: | |
| 1. Put oats and milk in bowl |
This file contains hidden or 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
| public deepUpdateArray<T, I>(current: T[], incoming: T[], getIdentifier: (item: T) => I, onUpdate: (current: T, incoming: T) => void): void { | |
| for (let i = current.length - 1; i >= 0; i--) { | |
| const currentItem = current[i]; | |
| const matchingIncomingItem = incoming.find(o => getIdentifier(o) === getIdentifier(currentItem)); | |
| if (!matchingIncomingItem) { | |
| current.splice(i, 1); | |
| continue; | |
| } |
This file contains hidden or 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
| Sub replaceTextAndSaveAsPng() | |
| 'This script replaces text in a specific text box inside a group, change variables as necessary | |
| Dim names As Variant | |
| Dim name As Variant | |
| Dim nameString As String | |
| Dim filePath As String | |
| names = Array("firstname lastname", "another name") | |
| For Each name In names |
This file contains hidden or 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
| case WM_SETCURSOR: { | |
| if ((HWND)wP == *mwns::MyButton.GetHandle()) { | |
| SetCursor(LoadCursor(NULL, IDC_HAND)); | |
| } | |
| else if (DraggingText) { | |
| SetCursor(LoadCursor(NULL, IDC_SIZEALL)); | |
| } | |
| else { | |
| SetCursor(LoadCursor(NULL, IDC_ARROW)); | |
| } |
This file contains hidden or 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
| //This example text box class (MyText is an object) as a wrapper for a text box, with getters for the text box's properties | |
| /*General idea is that WM_LBUTTONDOWN is called on left mouse click, and checks whether the click was inside the text box's region. | |
| If it is, the DraggingText bool remembers the text box is being dragged. The WM_MOUSEMOVE case is called when the mouse is moved. | |
| If the box is being dragged, it captures the cursor's position and uses SetWindowPos to update the text box's coordinates to the cursor | |
| position. The coordinates are also updated in the MyText object for future reference. WM_LBUTTONUP is called when the left mouse button | |
| is released, stopping the dragging process*/ | |
| //Cases exist in window procedure for the text box's parent window | |
| case WM_LBUTTONDOWN: { | |
| POINT pos; | |
| pos.x = LOWORD(lP); |