Skip to content

Instantly share code, notes, and snippets.

@shimondoodkin
shimondoodkin / php_tiny_curl.php
Last active May 6, 2024 10:51
php tiny curl - a curl function with method, data, headers, cookies, simple to use.
function encodeURIComponent($str) {
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
class curl_onHeaders
{
@gaabora
gaabora / php_tiny_curl.php
Created January 9, 2018 09:56 — forked from shimondoodkin/php_tiny_curl.php
php tiny curl - a curl function with method, data, headers, cookies, simple to use.
function encodeURIComponent($str) {
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
class curl_onHeaders
{
@nitred
nitred / optimal_mtu.md
Last active May 6, 2024 10:50
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@gaabora
gaabora / batch-style-replace-magic.html
Last active May 6, 2024 10:50
batch-style-replace-magic.html
<!DOCTYPE html>
<html>
<head>
<title>Test report tpl vars</title>
<style>
* { font-size: 10px; }
html, body { margin: 0; padding: 0; }
body { padding: 0 5px; }
.container { height: 100%; display: flex; flex-direction: row; }
.fill-height { height: 100vh; }
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Eu te amo Anderson</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
@gaabora
gaabora / webflow-variables-csv-export-import-magic.user.js
Last active May 6, 2024 10:50
Webflow Variables Export Import Magic
// ==UserScript==
// @name Webflow Variables CSV Export Import Magic
// @namespace http://tampermonkey.net/
// @version 0.6
// @description try to take over the world!
// @author gaabora
// @match https://webflow.com/design/*
// @match https://*.design.webflow.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=webflow.com
// @grant none
@jhned
jhned / awesome-wordpress-favicons
Last active May 6, 2024 10:50
Ever wanted to set up custom favicons in the WordPress admin or on the WordPress login screen? Well, now you can.
// First, create a function that includes the path to your favicon
function add_favicon() {
$favicon_url = get_stylesheet_directory_uri() . '/images/icons/admin-favicon.ico';
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}
// Now, just make sure that function runs when you're on the login page and admin pages
add_action('login_head', 'add_favicon');
add_action('admin_head', 'add_favicon');
@pwlin
pwlin / gist:8a0d01e6428b7a96e2eb
Last active May 6, 2024 10:50
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@itod
itod / split_keyboards.md
Last active May 6, 2024 10:50
Every "split" mechanical keyboard currently being sold that I know of
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 6, 2024 10:50
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !