Skip to content

Instantly share code, notes, and snippets.

@ElefHead
ElefHead / Installing_theano_and_pymc3.md
Last active January 16, 2025 21:03
A guide to install pymc3, theano with CUDA on windows 10 -- Dec 2019

I am writing this gist because I spent 6 hours navigating links trying to get Theano to work with CUDA on windows 10. Hopefully, you wouldn't have to. Once theano is setup and running, you can install pymc3 and it all works. I had tensorflow-gpu setup and running on windows 10; it isn't as simple as pip install theano.

I will list down the instructions, with the links where I found them. Hope this helps someone.

This set of instructions depend on anaconda. Also, this is sort of hacky in the end.

Ok let's begin.


@Kristoff-Verschueren
Kristoff-Verschueren / CredentialProvider.cs
Last active January 16, 2025 21:03
Optimized ChainedTokenCredential
public static class CredentialProvider
{
public static ChainedTokenCredential GetCredentials()
{
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (string.Equals(environment, "Development", StringComparison.OrdinalIgnoreCase))
{
return new ChainedTokenCredential(
new AzureCliCredential(),
@hackermondev
hackermondev / zendesk.md
Last active January 16, 2025 21:02
1 bug, $50,000+ in bounties, how Zendesk intentionally left a backdoor in hundreds of Fortune 500 companies

hi, i'm daniel. i'm a 15-year-old with some programming experience and i do a little bug hunting in my free time. here's the insane story of how I found a single bug that affected over half of all Fortune 500 companies:

say hello to zendesk

If you've spent some time online, you’ve probably come across Zendesk.

Zendesk is a customer service tool used by some of the world’s top companies. It’s easy to set up: you link it to your company’s support email (like [email protected]), and Zendesk starts managing incoming emails and creating tickets. You can handle these tickets yourself or have a support team do it for you. Zendesk is a billion-dollar company, trusted by big names like Cloudflare.

Personally, I’ve always found it surprising that these massive companies, worth billions, rely on third-party tools like Zendesk instead of building their own in-house ticketing systems.

your weakest link

@aagontuk
aagontuk / x86_64.md
Last active January 16, 2025 20:58
Resources on x86_64 ISA

x86_64 Assembly Resources

@ih2502mk
ih2502mk / list.md
Last active January 16, 2025 20:54
Quantopian Lectures Saved
@TobiasHoll
TobiasHoll / sleepy.c
Created January 26, 2019 06:16
LD_PRELOAD library to disable calls to alarm(). Useful for CTF challenges.
/*
* This library, when included in LD_PRELOAD, disables or delays alarm() calls
* by a user-specified time. Useful for CTF challenges that seem to think
* they need to annoy us with alarm().
*
* Copyright (C) 2018 - Tobias Holl
* 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 without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
@hwvs
hwvs / fix_cudaHostRegister.py
Last active January 16, 2025 20:49
[PyTorch] Forcibly fix cudaHostRegister->pinned_use_cuda_host_register:False on Windows with Nvidia GTX 1070/1080
import torch
import re
# ....
# Fix for cudaHostRegister on Windows with Nvidia GTX 1070/1080 ( Hunter Watson | github.com/hwvs )
# Resolves: "RuntimeError: Host and device pointer dont match with cudaHostRegister. Please dont use this feature by setting PYTORCH_CUDA_ALLOC_CONF=use_cuda_host_register:False (default)"
# Tested on:
# -- Unsloth 2025.1.1: Fast Qwen2 patching. Transformers: 4.46.3.
# -- GPU: NVIDIA GeForce GTX 1070. Max memory: 8.0 GB. Platform: Windows.
@philschmid
philschmid / get_memory_size.py
Created January 16, 2025 13:53
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active January 16, 2025 20:48
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@Laith98Dev
Laith98Dev / custom_in_array.php
Last active January 16, 2025 20:48
Faster in_array
<?php
function custom_in_array(string|int $item, array $arr): bool
{
return preg_match('/\b(' . implode("|", array_map(fn($word) => preg_quote($word, "/"), $arr)) . ')\b/i', $item) === 1;
}
// 800 element
$myArray = [
"j8onxb92q6lmuzjmby7e",