TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| MainActivity.java: | |
| package com.sunmeat.myapplication; | |
| import android.os.Bundle; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import androidx.appcompat.app.AppCompatActivity; | |
| import androidx.recyclerview.widget.GridLayoutManager; |
| #!/usr/bin/python | |
| from impacket import smb | |
| from struct import pack | |
| import os | |
| import sys | |
| import socket | |
| ''' | |
| EternalBlue exploit for Windows 8 and 2012 | |
| The exploit might FAIL and CRASH a target system (depended on what is overwritten) |
| function Wait-File { | |
| <# | |
| .SYNOPSIS | |
| Monitors a file system path for changes and executes a script block in response to specified events. | |
| .DESCRIPTION | |
| The Wait-File function creates a FileSystemWatcher to monitor a specified directory for file system changes. | |
| It registers event handlers for specified events (Created, Changed, Deleted, Renamed) and executes a | |
| custom action when those events occur. The function runs continuously until manually stopped (Ctrl+C). |
| ## Unity ## | |
| *.cs diff=csharp text | |
| *.cginc text | |
| *.shader text | |
| *.mat merge=unityyamlmerge eol=lf | |
| *.anim merge=unityyamlmerge eol=lf | |
| *.unity merge=unityyamlmerge eol=lf | |
| *.prefab merge=unityyamlmerge eol=lf |
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The SPARC Automated Development System (claude-sparc.sh) is a comprehensive, agentic workflow for automated software development using the SPARC methodology (Specification, Pseudocode, Architecture, Refinement, Completion). This system leverages Claude Code's built-in tools for parallel task orchestration, comprehensive research, and Test-Driven Development.
| :: | |
| :: Reclaims Windows disk space in a "destructive" manner (can't uninstall service packs and updates afterwards, etc.). | |
| :: Use at your own risk. Useful for Windows installations in space-constrained environments, such as a small Boot Camp | |
| :: partition on a Mac. | |
| :: | |
| :: [IMPORTANT] It is strongly suggested to make a full-disk backup of your Windows partition before running this script, | |
| :: as you can't roll back service packs and updates afterwards. | |
| :: | |
| :: [IMPORTANT] Run this script as admin (required to run `Dism.exe` among other things). | |
| :: |
| import SimpleITK as sitk | |
| # read image | |
| inputImage = sitk.ReadImage('/path/to/input.nii.gz') | |
| # get result in the form of a numpy array | |
| npa_res = my_algorithm(sitk.GetArrayFromImage(inputImage)) # my_algorithm does something fancy | |
| # Converting back to SimpleITK (assumes we didn't move the image in space as we copy the information from the original) | |
| result_image = sitk.GetImageFromArray(npa_res) |
| # 17 list comprehension problems in python | |
| fruits = ['mango', 'kiwi', 'strawberry', 'guava', 'pineapple', 'mandarin orange'] | |
| numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 23, 256, -8, -4, -2, 5, -9] | |
| # Example for loop solution to add 1 to each number in the list | |
| numbers_plus_one = [] | |
| for number in numbers: | |
| numbers_plus_one.append(number + 1) |
Background: I find Cursor struggles to retrieve content from Salesforce documentation links due to various approaches used such as as shadow dom and dynamic loading. This Cursor command leverages Cursors Browser Automation tool (needs to be explcitly enabled) to help give it a few more clues on how to deal with these pages. I initially built a shell script for it to call but then I discovered Cursor commands. So I built this command using Cursor itself once we had both figured this out - effectively it wrote its own instructions. Use at your own risk.
Usage: In Cursor type / and select Create Command enter sfdoc and press enter. Then paste the content below into the file. To use, use prompts like Read this https://developer.salesforce.com/docs... using /sfdoc
Extract Salesforce documentation content from [URL] using browser automation. The Salesforce docs use heavy JavaScript rendering with custom web components and shadow DOM. Follow this comprehensive approach based on successful s