Skip to content

Instantly share code, notes, and snippets.

! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheetlibgen.is
||wise.com/*
||sigplan.org/*
||chat.haskell.fun/*
||gitlab.com/*
||z-library.sk/*
||libgen.li/*
||readthedocs.io/*
||bitget.com/*
import kotlin.random.Random
data class Person(val name: String, val age: Int)
/**
* A comprehensive test program that demonstrates all ArrayList APIs in Kotlin
*/
fun main() {
readln();
testConstructors()
@HaskellZhangSong
HaskellZhangSong / allocate.c
Created August 28, 2025 07:43
allocate memory with mmap
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
// Size of allocation (1MB by default)
#define ALLOC_SIZE (1024 * 1024)
#include <iostream>
#include <sys/mman.h> // For mmap, munmap, MAP_FAILED, PROT_*, MAP_*
#include <unistd.h> // For sysconf, _SC_PAGESIZE
#include <cstring> // For strerror, memset
#include <cerrno> // For errno
#include <cstdint> // For uintptr_t
int main() {
size_t size = 256 * 1024; // Allocate 4KB, typically one page
set main-view-id = yes
set main-view-id-width = 16
set main-view-date = custom
set main-view-date-format = "%Y-%m-%dT%H:%M:%S%Z"
set main-view-author-width = 20
bind generic C none
bind generic C !<git checkout %(commit)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "flutter_tools",
"request": "launch",
fe4e273dccb328ea5e2291a730cf527cf7282187
pip install esdk-obs-python --trusted-host pypi.org
{
"tag": "",
"files": {
"darwin-arm64": "/Users/username/flutter_engine_3.22/artifacts.zip"
}
}
FLUTTER_OHOS_STORAGE_BASE_URL=https://flutter-ohos.obs.cn-south-1.myhuaweicloud.com
alias gp="git pull"
alias gpr="git pull --rebase"
alias gc="git checkout ."
alias grs="git reset ."
alias gps="git push"
alias gpf="git push -f"
alias gcan="git commit --amend"
alias gcane="git commit --amend --no-edit"
alias gs="git status"
alias gd="git diff"
@HaskellZhangSong
HaskellZhangSong / config
Last active July 4, 2024 07:44 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = <Name>
email = <email>
username = <username>
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@HaskellZhangSong
HaskellZhangSong / gist:c9c7769587d87013cae16547d2519147
Last active July 17, 2021 06:29
Block Sougou InputMethod to access Internet on Windows
New-NetFirewallRule -DisplayName "Block Sougou ConfigIE TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ConfigIE.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ConfigIE UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ConfigIE.exe" -Protocol UDP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ErrorReport TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ErrorReport.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ErrorReport UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ErrorReport.exe" -Protocol UDP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ImeUtil TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ImeUtil.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ImeUtil UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWB