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
<?php | |
use Amp\Future; | |
use Amp\Socket\ConnectContext; | |
use Amp\TimeoutCancellation; | |
use function Amp\async; | |
use function Amp\Socket\connect; | |
/** | |
* Class UdpClient |
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
namespace WindowsGSM.Utilities | |
{ | |
public static class TaskEx | |
{ | |
public static async Task Run(Action action) | |
{ | |
Exception? exception = await Task.Run(() => | |
{ | |
try | |
{ |
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
@inherits MudTextField<string> | |
@{ | |
base.BuildRenderTree(__builder); | |
} | |
@code { | |
protected override void OnInitialized() | |
{ | |
base.AdornmentIcon = Icons.Material.Filled.VisibilityOff; |
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
// Create an array of ascending numbers (1-49) -> suffle -> take first 6 number in suffled array -> sort ascendingly | |
console.log(Array(49).fill().map((_, i) => 1 + i).sort(() => .5 - Math.random()).slice(0, 6).sort((a, b) => a - b)); | |
// Example output | |
// [ 1, 8, 15, 22, 44, 46 ] | |
// [ 3, 8, 34, 35, 41, 45 ] | |
// [ 11, 14, 26, 40, 48, 49 ] |
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
/** | |
* Gate.io Websocket v4 (lightweight) | |
* | |
* @author BattlefieldDuck | |
* @since 11/11/2021 | |
*/ | |
const { createHmac } = require('crypto'); | |
const EventEmitter = require('events'); | |
const WebSocket = require('ws'); |
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
import asyncio | |
async def test(i): | |
print(str(i) + ' - start') | |
await asyncio.sleep(1) | |
print(str(i) + ' - end') | |
# Faster! | |
async def start_start_end_end(): | |
tasks = [test(i) for i in range(10)] |
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
private void SetStartOnBoot(bool enable) | |
{ | |
try | |
{ | |
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true); | |
var productName = System.Windows.Forms.Application.ProductName; | |
if (enable) | |
{ | |
key.SetValue(productName, System.Windows.Forms.Application.ExecutablePath); | |
} |
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
# A Simple Shell Script To Restart SteamBot.exe With Mono and Screen | |
# BattlefieldDuck - 11/13/2019 | |
# | |
# Set crontab: | |
# 1. crontab -e | |
# 2. 0 */3 * * * ./steambot.sh | |
# | |
echo "Sending quit to SteamBot.exe..." |
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
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
void checkPalindromes(int, int, bool); | |
int main() | |
{ | |
//Able to edit the value | |
int test_range = 50000; |
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
#define FSOLID_NOT_SOLID 0x0004 | |
#define EF_NOSHADOW (1 << 4) | |
#define EFL_FORCE_CHECK_TRANSMIT (1<<7) | |
int CreateSniperDot(int client) | |
{ | |
int sniperdot = CreateEntityByName("env_sniperdot"); | |
if (IsValidEntity(sniperdot)) | |
{ | |
SetEntityMoveType(sniperdot, MOVETYPE_NONE); | |
SetEntProp(sniperdot, Prop_Send, "m_usSolidFlags", GetEntProp(sniperdot, Prop_Send, "m_usSolidFlags")|FSOLID_NOT_SOLID); |
NewerOlder