Skip to content

Instantly share code, notes, and snippets.

View sonnyp's full-sized avatar
🛠️

Sonny sonnyp

🛠️
View GitHub Profile
function fixedEncodeURIComponent(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, (c) => {
return `%${c.charCodeAt(0).toString(16)}`;
});
}
function urlEncode(params) {
let data = '';
Object.keys(params).forEach((key, idx, { length }) => {
const k = fixedEncodeURIComponent(key.toString());
import {AppState} from 'react-native';
import xml from './xmpp/packages/xml';
// https://xmpp.org/extensions/xep-0352.html
// https://facebook.github.io/react-native/docs/appstate
module.exports = function csi({entity}) {
let supported = false;
let inactive = false;
#!/usr/bin/env gjs
const { GLib, GUPnP } = imports.gi;
const { MainLoop } = GLib;
const mainloop = new MainLoop(null, true);
function getExternalIpAddress() {
// does it work with interface: null or without