Skip to content

Instantly share code, notes, and snippets.

View gaycookie's full-sized avatar
🌈

> GayCookie ✌ gaycookie

🌈
View GitHub Profile
@raws
raws / WeightedCollection.java
Created January 24, 2012 04:24
Weighted randomization in Java
import java.util.NavigableMap;
import java.util.Random;
import java.util.TreeMap;
public class WeightedCollection<E> {
private NavigableMap<Integer, E> map = new TreeMap<Integer, E>();
private Random random;
private int total = 0;
@tommyready
tommyready / NetworkAdaptersUtility.cs
Last active April 18, 2024 15:01
Using C# to Disable and Enable a Network Adapter
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace NetworkAdaptersUtility
{
class Program
{
static void Main(string[] args)
{
@KingCprey
KingCprey / fivem_keys.lua
Last active July 9, 2024 23:16
FiveM IsControlPressed keys
--IsControlPressed(0,x)
local keys={}
keys[34]="A"
keys[29]="B"
keys[26]="C"
keys[30]="D"
keys[46]="E"
keys[49]="F"
keys[47]="G"
keys[74]="H"
@k3kdude
k3kdude / DiscordWebhook.java
Created August 17, 2017 15:31
Java DiscordWebhook class to easily execute Discord Webhooks
import javax.net.ssl.HttpsURLConnection;
import java.awt.Color;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@MPThLee
MPThLee / enableDiscordExperiments.js
Last active June 20, 2024 12:30
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@gaycookie
gaycookie / config.py
Last active April 14, 2020 12:53
YAML ConfigParser
from yaml import safe_load, YAMLError
class ConfigParser:
def __init__(self, file_name):
self.config = self.__load(file_name)
def __load(self, file_name=''):
if len(file_name) == 0:
file_name = 'config.yaml'

Keybase proof

I hereby claim:

  • I am azurebluemonster on github.
  • I am cornland (https://keybase.io/cornland) on keybase.
  • I have a public key ASBXG0OeImw_lNcqjX0TWSbk_Mif5Yq7X6Up90xBnkWWhgo

To claim this, I am signing this object:

@dunkelstern
dunkelstern / README.md
Created May 8, 2023 17:58
Systemd Unit for running python application in virtualenv

Assumptions

  • Username is user
  • User is in group user
  • User's home is /home/user
  • Python application is in /home/user/pythonapp
  • Python script is named start.py
  • Virtual environment is /home/user/.virtualenvs/pythonapp created with python -m venv /home/user/.virtualenvs/pythonapp

You can add multiple Environment lines if you need more env-variables