This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cli_default_open_behavior": "new_window", | |
| "git": { | |
| "inline_blame": { | |
| "enabled": false, | |
| }, | |
| }, | |
| "auto_update": false, | |
| "soft_wrap": "editor_width", | |
| "buffer_font_family": "DejaVu Sans Mono", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require Bitwise | |
| import Bitwise | |
| defmodule IntToBin do | |
| def call(int, endian \\ :little), do: do_call(int, <<>>, endian) | |
| defp do_call(0, <<>>, _), do: <<0>> | |
| defp do_call(0, buff, _), do: buff | |
| defp do_call(int, buff, endian) do | |
| byte = int &&& 0xFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scrot -fs -e 'xclip -f -selection clipboard -target image/png -i $f' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ALPHABET: [char; 16] = | |
| ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; | |
| // Do not use in production: | |
| // - does not check base 0 | |
| // - u128 instead of generic | |
| // - no negative support | |
| fn to_s(num: u128, base: u128) -> String { | |
| let mut buffer: String = String::new(); | |
| let mut div = num; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "inbounds": [ | |
| { | |
| "port": 443, | |
| "protocol": "vless", | |
| "settings": { | |
| "clients": [ | |
| { | |
| "id": "{xray uuid}", | |
| "flow": "xtls-rprx-vision" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "inbounds": [ | |
| { | |
| "port": 1080, | |
| "protocol": "socks", | |
| "settings": { | |
| "udp": true | |
| } | |
| } | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn int_to_bytes(num: u32) -> Vec<u8> { | |
| let mut bytes: Vec<u8> = | |
| (0..4).map(|offset| ((num >> offset * 8) & 0xFF) as u8).collect(); | |
| bytes.reverse(); | |
| bytes | |
| } | |
| fn main() { | |
| let res = int_to_bytes(1234u32); | |
| println!("{:?}", res); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | |
| import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; | |
| using MessageHashUtils for bytes; | |
| using ECDSA for bytes32; | |
| contract AddressExtractor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn qs<T: std::cmp::Ord>(a: &mut [T]) { | |
| if a.len() <= 1 { return; } | |
| let last_index = a.len() - 1; // pivot index | |
| let mut partition_index = 0; | |
| for i in 0..last_index { | |
| if a[i] >= a[last_index] { continue; } | |
| a.swap(i, partition_index); | |
| partition_index += 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Show list of process affinities omitting threads | |
| for pid in $(ps --ppid 2 -p 2 --deselect -o pid=); do taskset -pc $pid 2>/dev/null; done |
NewerOlder