Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@qezz
qezz / noMangleGoogle.user.js
Last active September 29, 2021 09:09 — forked from radiantly/noMangleGoogle.user.js
Prevent Google from mangling links (Works on TamperMonkey, Firefox)
// ==UserScript==
// @name Prevent link mangling on Google
// @namespace LordBusiness.LMG
// @include https://www.google.com/search*
// @grant none
// @version 1.1
// @author radiantly
// @description Prevent google from mangling the link when copying or clicking the link on Firefox
// ==/UserScript==
// For example we have a depth component
glTexImage2D(GL_TEXTURE_2D, 0,GL_DEPTH_COMPONENT16, 1024, 1024, 0,GL_DEPTH_COMPONENT, GL_FLOAT, 0);
// So we actually need to enable these parameters to allow shadow mapping
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
def positive_counter():
x = 0
def tick():
nonlocal x
print(x)
x += 1
return tick
c = positive_counter()
@qezz
qezz / playground.rs
Created August 3, 2015 16:21 — forked from anonymous/playground.rs
Shared via Rust Playground
fn main() {
enum Void {}
let res: Result<u32, Void> = Ok(0);
// Err doesn't exist anymore, so Ok is actually irrefutable.
// `Void` must be covered here
let Ok(num) = res;
}
@qezz
qezz / playground.rs
Last active August 29, 2015 14:26 — forked from anonymous/playground.rs
Shared via Rust Playground
struct Yell { name: &'static str }
impl Drop for Yell {
fn drop(&mut self) {
println!("{} dropped!", self.name);
}
}
fn main() {
let bob = Yell { name: "Bob" };
let carol = Yell {
#define G(n) int n(int t, int q, int d)
#define X(p,t,s) (p>=t&&p<(t+s)&&(p-(t)&1023)<(s&1023))
#define U(m) *((signed char *)(m))
#define F if(!--q){
#define I(s) (int)main-(int)s
#define P(s,c,k) for(h=0; h>>14==0; h+=129)Y(16*c+h/1024+Y(V+36))&128>>(h&7)?U(s+(h&15367))=k:k
G (B)
{
Z;