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:
I hereby claim:
To claim this, I am signing this object:
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?
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) |
⚠️ 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,
The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
#!/usr/bin/env python3 | |
import asyncio | |
import ssl | |
@asyncio.coroutine | |
async def echo_client(data, loop): | |
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) | |
ssl_ctx.options |= ssl.OP_NO_TLSv1 |
: By the power of this magic string: ex: set ft=markdown ;:<<'```shell' #
, this file is now both a markdown document and an executable shell script. chmod +x
it and try running it!
The above line does just what it says. More specifically, when placed within in the first 5 lines and preceded only by blank lines or #
-prefixed markdown headers:
```shell
block.(The line also has to start with a :
so that it's valid shell code.)
#ifndef _MACARON_BASE64_H_ | |
#define _MACARON_BASE64_H_ | |
/** | |
* The MIT License (MIT) | |
* Copyright (c) 2016-2024 tomykaira | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including |
/* | |
* Copyright 2014 Jonathan Bradshaw. All rights reserved. | |
* Redistribution and use in source and binary forms, with or without modification, is permitted. | |
*/ | |
using System; | |
using System.Collections.Specialized; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; |