Skip to content

Instantly share code, notes, and snippets.

View sokcuri's full-sized avatar

Sokcuri sokcuri

View GitHub Profile
@Luc1412
Luc1412 / auth_flow.py
Last active March 15, 2024 11:16
This is the auth flow for valorant (async) + Some further research I did in the past
import re
import aiohttp
async def run(username, password):
session = aiohttp.ClientSession()
data = {
'client_id': 'play-valorant-web-prod',
'nonce': '1',
'redirect_uri': 'https://beta.playvalorant.com/opt_in',
'response_type': 'token id_token',
@n1215
n1215 / TimeTravel.php
Created November 21, 2019 06:21
Laravel Middleware for time travel debugging
<?php
declare(strict_types=1);
namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
use Exception;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Cookie;
@oskar456
oskar456 / wgcf.py
Last active February 17, 2024 12:47
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
@aslilac
aslilac / crc32.js
Last active August 20, 2021 09:10
A JavaScript/TypeScript CRC32 implementation in only 18 lines of code.
// Copyright 2019 McKayla Washburn
// MIT License
// Feel free to use this however you want for whatever you want.
// Just note that the function returns a signed 32 bit number.
// This is a limitation of JavaScript's bitwise operators.
// If the value you are checking against is unsigned, then you
// can convert it to a signed 32 bit number by doing a bitshift of 0.
// Ex:
@harrysbaraini
harrysbaraini / App\Http\Resources\EventResource.php
Created July 29, 2019 16:31
Laravel API Resources with permissions and links
<?php
namespace App\Http\Resources;
use App\Http\Handlers\Admin\UploadMediaFile;
use App\Http\Resources\Support\ResourceLink;
use App\Policies\EventPolicy;
use Illuminate\Support\Facades\Auth;
class EventResource extends ItemResource
@yuyoyuppe
yuyoyuppe / transparent_imgui.cxx
Created March 22, 2019 15:35
Proof of concept that ... DXGI_ALPHA_MODE_PREMULTIPLIED doesn't work. Just use small borderless window and set bg_color to rgba(x,x,x,1)
#ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
#pragma comment(lib, "user32.lib")
#include <wrl.h>
#include <dxgi1_3.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1_2helper.h>
@arei
arei / IntroZephJS.md
Last active June 26, 2020 01:15
Introducing ZephJS!

Introducing ZephJS

We are pleased to announce the release of ZephJS!

ZephJS is an extremely easy to use, simple to understand, ultra-light framework for defining and using Web Components. ZephJS is perfect for people writing component libraries, teams building applications or sites that just require a few custom components, or projects building whole applications that do not want the gigantic weight of a modern JavaScript browser framework. ZephJS simplifies the process of defining custom Web Components into a highly readable declarative structure that uses standard JavaScript, standard HTML markup, and standard CSS styling. And ZephJS weighs in at less than 20k minified!

Here's an example of using ZephJS to build a customized button:

my-button.js
@andromedarabbit
andromedarabbit / Dockerfile
Last active March 26, 2024 04:34
Create or modify the AWS security group, which only allows GitHub servers to access to our services
FROM python:3.7
# Set the timezone to KST
RUN cat /usr/share/zoneinfo/Asia/Seoul > /etc/localtime
RUN set -ex \
&& apt-get clean && apt-get update \
&& apt-get install --no-install-recommends -y groff \
&& rm -rf /var/lib/apt/lists/*
@krzys-h
krzys-h / UnityWebRequestAwaiter.cs
Created July 20, 2018 22:47
[Unity] Use UnityWebRequest with async/await
public class UnityWebRequestAwaiter : INotifyCompletion
{
private UnityWebRequestAsyncOperation asyncOp;
private Action continuation;
public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp)
{
this.asyncOp = asyncOp;
asyncOp.completed += OnRequestCompleted;
}
// extension awaiter/methods can be used by this namespace
using UniRx.Async;
// You can return type as struct UniTask<T>, it is unity specialized lightweight alternative of Task<T>
// no(or less) allocation and fast excution for zero overhead async/await integrate with Unity
async UniTask<string> DemoAsync()
{
// You can await Unity's AsyncObject
var asset = await Resources.LoadAsync<TextAsset>("foo");