Skip to content

Instantly share code, notes, and snippets.

@lucprincen
lucprincen / Save.php
Last active December 13, 2024 15:40
Saves a WordPress FSE pattern on the local environment.
<?php
namespace WotW\Theme\Patterns;
use WotW\Theme\Contracts\Interfaces\Hookable;
class Save implements Hookable{
public function register_hooks(): void {
@Tesla2550
Tesla2550 / IBSng Install
Created December 13, 2024 15:39 — forked from soheilsec/IBSng Install
IBSng Install
yum install httpd php postgresql postgresql-server postgresql-python perl iptables-services tar zip unzip wget nano bzip2 install nano lsof net-tools -y
nano /etc/selinux/config
wget https://managedway.dl.sourceforge.net/project/ibsng/IBSng-A1.24.tar.bz2
tar -xvjf IBSng-A1.24.tar.bz2 -C /usr/local
@futurGH
futurGH / bubbleSort.ts
Last active December 13, 2024 15:38
A TypeScript type-only bubble sort
// https://www.typescriptlang.org/play#code/C4TwDgpgBAyg9gJ2BAJlAvFAQgVwEZ4A2E8SAPANoCMANFACx21QDMdATHQLQCcdAHHQDs3TlABsdRlCrSu7ZlUEzmQtlHbsAugD4AsACgA9EahmAegH5DhkyahdHT5y65YAqliwAZAKKwAeQAlABVXcKcbA1BIbHwiEkRgMgA5KAgAD2QAOxQAZyhsnABbPAgECl0MQzNcAmJSYAAFAEM8vNSddKyIXIKAS2yAM3KoAOyIVvbunPzCkrKKrRqzKEs4+sSkKY7xyba8rszZgrqExp3OldW1jfOky5T9AxuzAC47hqSyPZ3nm4+EwAbuUojFoGcvtsDqkZr05kVSuVKl10Cs0sd4QUKIMRggoAAxfoIPLAOF9eZIhB0XGjGAQADGcFy5IRC3KdAAdNzafighBSayCojFpVli9Vut+YLMRTKtdJVBvAK8iEABYtbJkIkk4B0elM3JHHoU4AIHAQBU3dYUHWk-WM5kocWvVYfCgGp10O3AF2vD7K9rqzXa4n22COo1CqBmi1WxW2sN6qDczmQrbNGEeyMoLnc6W+nR+13uz25PNp+JQzPtSg+isF3TFqCAiAghBROymCLhdwhACS3n7IQAmlBR01fDAe64weBoIHVRqtQBBaMijnYdfshColZr2VzLAK9ZDFqEPKWiXvKAAAwAJABvFcAX1v0dvXCfvKgK7weQPE02SpN943WB9HywN8Py-R8fz-PIsG3EDb3jMx1kXYNV3-LA6AQlcunsNcyCgAAGOgkJI0i0JbGNzWgIioCoiioB0TBqOvN07yfKD30PApPyfDcEFAzj0KgM8LwY0w1zYsiWKo+MPhgfAzRaBlkhXCjjROQo21GewkK6FcaPWWMr1dG9JMvOdYhXFAUDIQDdOElj+MpRZUSgChUxCHAwGIAIhmVbIAHNgDVJydArPyAogIKQvCyKsCLCgACJiDCiK0q0ABuWzoBUvA1I0pzkMWNygOFHc
@soheilsec
soheilsec / IBSng Install
Created October 4, 2023 16:32
IBSng Install
yum install httpd php postgresql postgresql-server postgresql-python perl iptables-services tar zip unzip wget nano bzip2 install nano lsof net-tools -y
nano /etc/selinux/config
wget https://managedway.dl.sourceforge.net/project/ibsng/IBSng-A1.24.tar.bz2
tar -xvjf IBSng-A1.24.tar.bz2 -C /usr/local
@mjpieters
mjpieters / CodeLLDB-rust-auto-sourcemap.md
Created June 17, 2024 12:28
CodeLLDB & Rust: Automatically add a source map to LLDB for the Rust stdlib

Automatically set the correct source map for your Rust toolchain

When it comes to debugging Rust in VSCode, the CodeLLDB extension provides a great debugging experience. Until you try to step into some Rust stdlib code and are greeted with assembly.

Of course you can manually add a source map entry for your rust toolchain, which involves finding the current rustc version commit hash and the sysroot path for the source code:

$ rustc --version --verbose
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
@cloudwu
cloudwu / json.lua
Last active December 13, 2024 15:33
An inefficient but minimalist pure lua json parser
-- An inefficient but minimalist pure lua json parser
local escape_table = {
['"'] = '"',
['/'] = '/',
['\\'] = '\\',
['b'] = '\b',
['f'] = '\f',
['n'] = '\n',
['r'] = '\r',

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

@devdrops
devdrops / example.md
Last active December 13, 2024 15:30
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@cobyism
cobyism / gh-pages-deploy.md
Last active December 13, 2024 15:30
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@tugytur
tugytur / offline-election-howto.md
Last active December 13, 2024 15:28
Simulate the Polkadot offline-election