Skip to content

Instantly share code, notes, and snippets.

View DaggieBlanqx's full-sized avatar
:atom:
Shall we ?

Daggie Blanqx (Douglas Mwangi) DaggieBlanqx

:atom:
Shall we ?
View GitHub Profile
@DaggieBlanqx
DaggieBlanqx / convert-cjs-to-esm.js
Last active March 31, 2026 18:50
Convert CJS to ESM
const fs = require('fs')
const path = require('path')
const files = process.argv.slice(2)
function convertFile (filePath) {
let src = fs.readFileSync(filePath, 'utf8')
const original = src
// 1. const X = require('y') → import X from 'y'
@DaggieBlanqx
DaggieBlanqx / convert-esm-to-cjs.js
Last active March 31, 2026 18:51
For converting ESM to CJS
const fs = require('fs')
const path = require('path')
const files = process.argv.slice(2)
function convertFile (filePath) {
let src = fs.readFileSync(filePath, 'utf8')
const original = src
// 1. import X from 'y' → const X = require('y')
import http.client
import json
conn = http.client.HTTPSConnection("insights.sandbox.africastalking.com")
payload = json.dumps({
"username": "sandbox",
"phoneNumbers": [
"+2547XXXXXXX"
]
})
@DaggieBlanqx
DaggieBlanqx / undo-twitter-retweets.js
Last active June 28, 2024 08:03
2024: Undo Retweets on X / Twitter
// Go to your twitter profile page, and paste in console
const undoRetweet = async () => {
try {
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
for (var i = 1; i < 500; i++) {
window.scrollTo(0, document.body.scrollHeight/2 || document.documentElement.scrollHeight/2)
await sleep(100)
@DaggieBlanqx
DaggieBlanqx / delete-twitter-likes.js
Last active June 28, 2024 08:02
2024: Delete all likes on X / Twitter
// 2024 works with x.com
// Go to your twitter profile page, and paste in console
setInterval(() => {
document.querySelectorAll('button[data-testid="unlike"]').forEach(button => button.click());
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight)
},1000);
// install the africastalking library from npmjs.org
const Africastalking = require('africastalking');
const AT = Africastalking({
username:'your-app-username',
apiKey:'your-apikey'
});
const sendSMS = async () => {
const output = await AT.send({
// install the africastalking library from npmjs.org
const Africastalking = require('africastalking');
const AT = Africastalking({
username:'your-app-username',
apiKey:'your-apikey'
}).AIRTIME;
const sendAirtime = async () => {
const output = await AT.send({
@DaggieBlanqx
DaggieBlanqx / twitter-remove-tweets.js
Created February 7, 2022 17:07 — forked from antlionguard/twitter-remove-tweets.js
With this script, you can remove all tweets you are tweeted on Twitter. Don't forget add your nickname to line 9. (The script begins 60 seconds after pasting the code.)
const timer = ms => new Promise(res => setTimeout(res, ms));
setInterval(async () =>
{
// Get all tweets
const allTweets = document.querySelectorAll('.css-1dbjc4n.r-18u37iz.r-1wbh5a2.r-13hce6t');
// Filter tweets
const filteredTweets = Array.prototype.slice.call(allTweets).filter(x => x.innerText === '@{YOUR_TWITTER_NICKNAME}'); // --> e.g. '@twitter'
@DaggieBlanqx
DaggieBlanqx / twitter-remove-retweets.js
Created February 7, 2022 17:02 — forked from antlionguard/twitter-remove-retweets.js
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('div[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('div[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}
@DaggieBlanqx
DaggieBlanqx / overview.svg
Created August 7, 2021 16:03
Overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.