Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am trungnghiatn on github.
  • I am trungnghiatn (https://keybase.io/trungnghiatn) on keybase.
  • I have a public key ASBz-vM0vhCYd-v7CwX-tiq_sURZ4KD2C2zc02wLbVN4VAo

To claim this, I am signing this object:

@nghlt
nghlt / DataUsage.swift
Created March 4, 2022 22:50 — forked from n-studio/DataUsage.swift
Get data usage with swift
#include <ifaddrs.h>
// http://stackoverflow.com/questions/25626117/how-to-get-ip-address-in-swift
func getIFAddresses() -> [String] {
var addresses = [String]()
// Get list of all interfaces on the local machine:
var ifaddr : UnsafeMutablePointer<ifaddrs> = nil
if getifaddrs(&ifaddr) == 0 {
@nghlt
nghlt / twitter-remove-retweets.js
Last active September 19, 2022 03:52 — 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) => {
// Unlike liked tweet
if (tweet.querySelector('div[data-testid="unlike"]') != null) {
await tweet.querySelector('div[data-testid="unlike"]').click();
await timer(250);
}
await tweet.querySelector('div[data-testid="unretweet"]').click();