// https://www.pcg-random.org/
fn pcg(n: u32) -> u32 {
var h = n * 747796405u + 2891336453u;
h = ((h >> ((h >> 28u) + 4u)) ^ h) * 277803737u;
return (h >> 22u) ^ h;
}| /// minimal example of adding a custom render pipeline in bevy 0.11. | |
| /// | |
| /// When this example runs, you should only see a blue screen. There are no | |
| /// vertex buffers, or anything else in this example. Effectively it is | |
| /// shader-toy written in bevy. | |
| /// | |
| /// This revision adds a post-processing node to the RenderGraph to | |
| /// execute the shader. Thanks to @Jasmine on the bevy discord for | |
| /// suggesting I take a second look at the bevy post-processing example | |
| /// |
| // Suppose you have a variable named `future` which implements the `Future` trait. | |
| let future: impl Future = ...; | |
| // This gist demonstrates how to run the future until completion using the `stdweb` crate. | |
| // The various imports. | |
| extern crate futures; | |
| extern crate stdweb; |
| # How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 ) | |
| # on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) | |
| # without using Razer's official uninstall tool. | |
| # Tested on OS X 10.11.5 in July 2016. | |
| # Edited with additional steps for later OS X versions, | |
| # contributed by commenters on this gist. | |
| # Step 1: In your terminal: stop and remove launch agents | |
| launchctl remove com.razer.rzupdater |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
querymutation
Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
| // Mini memory editor for Dear ImGui (to embed in your game/tools) | |
| // Animated GIF: https://twitter.com/ocornut/status/894242704317530112 | |
| // THE MEMORY EDITOR CODE HAS MOVED TO GIT: | |
| // https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor | |
| // Click "Revisions" on the Gist to see old version. |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
| constexpr unsigned int crc32_table[] = { | |
| 0, 0x77073096, 0xEE0E612C, 0x990951BA, | |
| 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, | |
| 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, | |
| 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, | |
| 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, | |
| 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, | |
| 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, | |
| 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, | |
| 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, |
| // Array shuffle for MooTools | |
| Array.implement({ | |
| shuffle: function(){ | |
| var i = this.length; | |
| if (i == 0) return; | |
| while (--i){ | |
| var j = Math.floor(Math.random() * ( i + 1 )); | |
| var tempi = this[i]; |