Skip to content

Instantly share code, notes, and snippets.

View erickythierry's full-sized avatar
👋
coding

Ericky Thierry erickythierry

👋
coding
  • freelancer
  • brasil
View GitHub Profile
@PurpShell
PurpShell / monitor.js
Created May 13, 2024 14:48
Monitor Socket messages on 2.3000x and above
if (!window.decodeBackStanza) {
window.decodeBackStanza = require("WAWap").decodeStanza;
window.encodeBackStanza = require("WAWap").encodeStanza;
}
require("WAWap").decodeStanza = async (e, t) => {
const result = await window.decodeBackStanza(e, t);
@TheAshwanik
TheAshwanik / Delete Project on Glitch
Last active May 14, 2024 06:16
Delete Project on Glitch
While you cannot delete the project itself yet, but you can delete the source code in your project by overwriting the glitch git repository with an empty new commit. This is very important if you just planned to play around but ended up writing important code onto glitch and have a fear of glitch.com getting hacked and your code getting compromised and published on the internet, or if you accidentally commited a private key to glitch and wanted to completely remove it.
on glitch website project edit page open Tools/Extras/Git,Import&Export/Write
Copy_link => is e.g. https://api.glitch.com/git/YOUR-PROJECT-NAME
Copy_user_name => is YOUR-RANDOMLY-GENERATED-GIT-USERNAME e.g. 1aaa1111-1111-aaa1-aa1111111111
on glitch website project edit page open Console(terminal)
git config receive.denyCurrentBranch updateInstead
on your local computer terminal
mkdir foobar
cd foobar
@tmarshall
tmarshall / useUnloadBeacon.js
Last active June 18, 2022 02:39
React hook for unload beacons
/*
see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
```jsx
const MyComponent = ({ children }) => {
// will get fired if the page unloads while the component is mounted
useUnloadBeacon({
url: 'https://api.my.site/route',
payload: () => {
return 'something'
@isaacgr
isaacgr / streamer.sh
Created June 2, 2019 22:09
Use FFMPEG to convert an rtsp stream to hls and write output to m3u8 file.
#!/bin/sh
# Convert rtsp stream to hls and write to file
ffmpeg -i "rtsp://admin:admin@192.168.2.77:554/cam/realmonitor?channel=1&subtype=0" -c copy -hls_time 2 -hls_wrap 10 "/var/www/html/streaming.m3u8"