Skip to content

Instantly share code, notes, and snippets.

View ALiwoto's full-sized avatar
🚩
Trying to experience new things

ALi.w ALiwoto

🚩
Trying to experience new things
  • Earth. under the blue sky
  • 04:13 (UTC +03:30)
View GitHub Profile

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@NepNet
NepNet / GlxBindingsContext.cs
Last active December 26, 2024 04:19
Bindings contexts for OpenTK 4. If you need to load the bindings for windows use the wgl one, for linux glx and if you use it in a cross platform app like a gtk one use the native bindings context, it will check the platform and use either wgl or glx depending on the platform. For Mac ¯\_(ツ)_/¯ idk, I don't have a mac to test
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using OpenTK;
public class GlxBindingsContext : IBindingsContext
{
[DllImport("libGL", CharSet = CharSet.Ansi)]
private static extern IntPtr glXGetProcAddress(string procName);
public IntPtr GetProcAddress(string procName)
@Justasic
Justasic / message.md
Last active December 22, 2022 22:10
.run() is bad for libraries

.run() is bad for libraries

As a developer I have noticed a trend in libraries where the library developer will write this amazing library that does everything you need it to except that it has a .run() or .start() method. The intent is for the user of said library to do the initialization code in the application entry point and then do something like return app.run();. Whether it's in Python, Java, C++, or Rust they all abstratct away the application's main event loop.

What is an event loop?

@ZipFile
ZipFile / README.md
Last active May 9, 2025 17:09
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python pixiv_auth.py login

    This will open the browser with Pixiv login page.

Keybase proof

I hereby claim:

  • I am jetstreamin on github.
  • I am dysk0n3kt (https://keybase.io/dysk0n3kt) on keybase.
  • I have a public key ASAx8H2rgt-74CDv7SGAuwcWvbA67ooI0WNLhIl6_UHMPwo

To claim this, I am signing this object:

// SPDX-License-Identifier: GPL-2.0
/*
* @author Ammar Faizi <[email protected]> https://www.facebook.com/ammarfaizi2
* @license GPL-2.0
* @package tgvisd::Main::Preload
*
* Copyright (C) 2021 Ammar Faizi <[email protected]>
*/
#if defined(__linux__)
@ALiwoto
ALiwoto / Dank.cs
Created July 27, 2021 10:23
Dank class for showing how to send a graphquery in C#
using System;
using System.Net;
using System.Text;
using System.IO;
using System.Collections;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.Json.Serialization;
using System.Text.Json;
@ALiwoto
ALiwoto / nana_spotify.py
Created July 31, 2021 11:46
Spotify module which was going to be used in Nana (by Sayan Biswas)
from httpx import AsyncClient
class SpotifyUser:
authorize_url = "https://accounts.spotify.com/authorize"
token_url = "https://accounts.spotify.com/api/token"
def __init__(self, client_id, client_secret, redirect_uri):
self.client_id = client_id
self.client_secret = client_secret
@Priler
Priler / chat_server.cpp
Last active December 5, 2022 11:22
??? :3
/* Лол, код из архива - файл датируется 2017 годом.
Написан был после недели изучения C++.
Реализует серверную часть чата на клиенте.
Код не полный, писался на скорую руку - так сказать proof of concept.
О, и да - семафоры это круто :3 */
#include <iostream>
#include <string>
#include <stdio.h>
#include <cstring>
#include <stdlib.h>
@PaulSonOfLars
PaulSonOfLars / inlineQueryUnhash.go
Created December 24, 2021 09:56
Telegram Inline query unhasher
import (
"bytes"
"encoding/base64"
"encoding/binary"
"fmt"
"strconv"
)
func UnpackInlineMessageId(inlineMessageId string) (int64, int64, int64, int64, error) {
bs, err := base64.RawURLEncoding.DecodeString(inlineMessageId)