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
find . -type d \( -name .git -o -name node_modules \) -prune -o -type f -name "*.js" -print | parallel grep -H "PeerConnection" {} |
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
public record SimilaritySearchRequest(String question, Integer limit, Double maximumDistance) { | |
public SimilaritySearchRequest { | |
if (limit == null) { | |
limit = 4; // Default value for limit is set to 4 | |
} | |
if (maximumDistance == null) { | |
maximumDistance = 1.0; // Default value for threshold is set to 1.0 |
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
(function() { | |
// Save the original WebSocket constructor | |
const OriginalWebSocket = window.WebSocket; | |
// Define a new constructor that modifies the WebSocket behavior | |
window.WebSocket = function(url, protocols) { | |
const ws = new OriginalWebSocket(url, protocols); | |
// Store the original send method | |
const originalSend = ws.send; |
This file has been truncated, but you can view the full file.
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
-- Drop existing tables if they exist | |
DROP TABLE IF EXISTS user_profile, inventory, order_detail, payment_details, shipping_details CASCADE; | |
-- User Profile Table | |
CREATE TABLE user_profile ( | |
user_id VARCHAR(100) PRIMARY KEY, | |
name VARCHAR(100), |
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
import java.util.ArrayList; | |
import java.util.List; | |
public class ClassicThread { | |
void handleRequest() { |
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
public static <T> void recordMemoryUsage(T count,Consumer<T> fn){ | |
Runtime runtime = Runtime.getRuntime(); | |
// Run the garbage collector | |
runtime.gc(); | |
// Calculate the used memory | |
long memory = runtime.totalMemory() - runtime.freeMemory(); | |
long startTime = System.nanoTime(); | |
System.out.println("Used memory before operation is: " + memory + " bytes"); |
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
-- Change the windows which should not be moved | |
set MAXIMUM_X_VALUE to 1900 | |
set positiontobemove to 0 | |
tell application "System Events" | |
set allProcesses to a reference to (every process whose background only is false) | |
set windowList to {} | |
repeat with thisProcess in allProcesses |
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
@echo off | |
set PORT_NUMBER= 8080 | |
netstat -a -n -o | findstr %PORT_NUMBER% > tmpFile | |
set /p input= < tmpFile | |
del tmpFile | |
set PROCESS_ID_INDEX=5 | |
for /F "tokens=%PROCESS_ID_INDEX% delims= " %%a in ("%input%") do set PROCESS_ID=%%a |
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
# deploy-3.sh | |
# deploy-o.sh | |
# deploy-l.sh | |
#To convert deploy to capture | |
rename 'deploy' capture *.sh |
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
function App() { | |
const [data, setData] = useState('Loading...'); | |
useEffect(() => { | |
getCompressedData().then((result) => { | |
setData(result); | |
}).catch((e) => { |
NewerOlder