Skip to content

Instantly share code, notes, and snippets.

@isaumya
isaumya / cf_cache_rules_implementation_guide_spcc.md
Last active April 19, 2024 09:11
Super Page Cache for Cloudflare — Guide for using Remove Cache Buster Query Parameter feature (when using Cache Everything page rule)

Implementation Guide for using "Remove Cache Buster Query Parameter" feature

The Super Page Cache for Cloudflare plugin has recently added the feature for using the Cache Everything pagerule withing the ?swcfpc=1 cache buster query paramater. This opens up so many new doors where users previously had to use the Cloudflare Workers to remove the cache buster.

With this new option now users are able to take advantage of Cloudflare Cache Everything page rule and take it to the next level by using the new Rulesets released by Cloudflare. Basically this is achived by taking advantage of the all new Cache Rules feature implemented by Cloudflare.


Setp 1 — Setting up the Cache Rules inside your Cloudflare Dashboard

The first thing that you need to do is, log-in to your Cloudflare Dahsbord and go to the domain/zone doe which you are setting up the [Super Page Cache for Cloudflare](https://wordpress.org/plug

Другие интересные штуки тут: https://t.me/notes_of_programmer

Текущие выполняемые запросы

select pid, user, client_addr, query_start, backend_type, substr(query, 0, 256) as query
from pg_stat_activity
where query_start is not null
  and client_addr is not null;
@jjb
jjb / file.md
Last active April 19, 2024 09:09
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There are various benchmarks and discussions. Legend had it that Jemalloc 5 doesn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. Someone offered a config for Jemalloc 5.

The recipe would be something like this (shown with official docker ruby image).

FROM ruby:3.1.2-bullseye

How to fix the "Failed to close file descriptor for child process (Operation not permitted)" in your docker ci build

Disclaimer

First off, I'm not a docker expert by any means. I just wanted my CI pipeline to work and went down the habbit hole. The solution I present can cause some security implications, be aware.

Cause

The problem is caused by a seccomp policy and a glibc >= 2.34 update that returns an EPERM (operation not permitted) insted of ENOSYS (function not implemented).

Solution/Workaround

@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active April 19, 2024 09:08
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些URL Schemes已失效,可在评论区留言指出!(最后更新于 2024.4.16)

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中

@sashabeep
sashabeep / test.php
Created February 15, 2023 16:33
Evo 2.0 api test
<?php
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', __DIR__."/");
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'http://sitename.tld/');
include_once(MODX_BASE_PATH."index.php");
$modx->db->connect();
if (empty ($modx->config)) {
@mietzen
mietzen / m720q_setup.md
Last active April 19, 2024 09:07
m720q Setup: i7 8700 65W

m720q Setup with an i7-8700 65W

I had trouble getting my i7-8700 65W to work in my m720q with a 65W PSU. It was working fine in Windows, but was throttling down first to 20 Watt, then to 15, 10, and finally to 7 Watt, which resulted in a maximum clock speed of 800 MHz.

The main problem seems to be a mix of crappy firmware settings from Lenovo/Intel (Reddit Post) and the weak power supply.

To fix this problem, we have to install some tools, and for them to work, you have to make sure that secure boot is OFF; otherwise, the kernel doesn't allow you to set the CPU power limits. The easiest way is to install in legacy mode; therefore, you need to disable secure boot and enable CSM in the BIOS, select legacy boot preferred.

@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@PrestonKnopp
PrestonKnopp / test_drag_and_drop.tscn
Created June 8, 2019 00:04
Examples of Godot's Control drag and drop functionality. Test it out by downloading this tscn and adding it to a Godot project. It is entirely self contained in one scene.
[gd_scene load_steps=6 format=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
class DragDataColor:
var sender: Object
var color: Color"
[sub_resource type="GDScript" id=3]