Skip to content

Instantly share code, notes, and snippets.

@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
#!/usr/bin/env bash
set -e
readonly CONTENT_MAIN_TF='module "wrapper" {}'
readonly CONTENT_VARIABLES_TF='variable "items" {
description = "Maps of items to create a wrapper from. Values are passed through to the module."
type = any
default = {}
}'
@gyulkkajo
gyulkkajo / c_cpp_properties.json
Last active December 13, 2024 15:27
IntelliSense config file for Linux kernel X86_64.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"LINUX_PATH/include",
"LINUX_PATH/include/uapi",
"LINUX_PATH/include/generated",
"LINUX_PATH/arch/x86/include",
@lucprincen
lucprincen / Save.php
Last active December 13, 2024 15:25
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 {
@almas
almas / ubuntu-on-mbp-a1707.md
Last active December 13, 2024 15:23 — forked from rob-hills/ubuntu-22.04-mbp-a1707.md
Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)(T1 chip)

Summary

Notes to install Ubuntu 22.04.4LTS (Upgraded to 24.04LTS) up and running on my 2017 MacBook Pro 15 inch (MacBookPro14,3).

Now everything except the TouchID (Fingerprint), Suspend and Hibernation seems to work for me.

About Ubuntu 24.04LTS: I tried to install Ubuntu 24.04 and didn't have success. There was a crash issue during installation. https://bugs.launchpad.net/subiquity/+bug/2065310 But I installed 22.04 and upgraded it to the 24.04LTS later and it working same as 22.04.4.

Useful References (not mentioned in the text)

@by12380
by12380 / amazon-lp-from-leetcode.txt
Last active December 13, 2024 15:22
Amazon LP Questions from LeetCode Interview Experiences
1.https://interviewgenie.com/blog-1/category/Amazon+interviews
2.https://www.youtube.com/channel/UCw0uQHve23oMWgQcTTpgQsQ/playlists
3.https://medium.com/@scarletinked/are-you-the-leader-were-looking-for-interviewing-at-amazon-8301d787815d
Tell me about a situation where you had a conflict with someone on your team. What was it about? What did you do? How did they react? What was the outcome?
Give an example of when you saw a peer struggling and decided to step in and help. What was the situation and what actions did you take? What was the outcome?
Tell me about a time you committed a mistake?
Tell me about a time when your earned your teammate's trust?