Skip to content

Instantly share code, notes, and snippets.

@Giacom
Giacom / block-ME-servers.ps1
Last active November 2, 2021 09:15
Powershell script that blocks the Middle East (ME) OW servers by retrieving the ip ranges from AWS and blocking them for Overwatch, preventing you from having any high ping games. Download the scripts as a zip (top right button), extract it to a folder, right click "block_ME-run_as_admin.bat" and click on "Run as administrator".
#Requires -RunAsAdministrator
param (
[switch]$remove = $false, # Use this switch to remove the rules
[string]$regionPrefix = "me-*", # The prefix of the region we'll be filtering, e.g: me = middle east, us = united states, eu = europe
[string]$ipRangeRequestUrl = "https://ip-ranges.amazonaws.com/ip-ranges.json", # AWS endpoint that'll give us our IP ranges to block
[string]$ruleDisplayName = "_OW_BlockMEServers", # The name of the firewall rule
[string]$ruleDescription = "Rule used to block the ME servers for OW" # The description of the firewall rule
)
// Type your code here, or load an example.
#include <cstddef>
#include <cstdlib>
#include <cstdio>
typedef unsigned long buf_t;
struct T {
unsigned long size;
T* next;
constexpr unsigned int length(const char* string) {
unsigned int i = 0;
while (string[i] != '\0') i++;
return i;
}
constexpr unsigned int generateHash(const char* string) {
unsigned int hash = 0;
unsigned int len = length(string);
This file has been truncated, but you can view the full file.
NABLED -DMODULE_OGG_ENABLED -DMODULE_OPENSSL_ENABLED -DOPENSSL_NO_ASM -DOPENSSL_THREADS -DL_ENDIAN /Icore /Icore\math /Itools /Idrivers /I. /IC:\Users\giaco\dev\angle\include /Iplatform\winrt /Idrivers\windows /Ithirdparty\zlib /Ithirdparty\openssl /Ithirdparty\openssl\crypto /Ithirdparty\openssl\crypto\asn1 /Ithirdparty\openssl\crypto\evp /Ithirdparty\openssl\crypto\modes /Ithirdparty\openssl\openssl
p12_init.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um\processthreadsapi.h(501): warning C4047: 'return': 'LPVOID' differs in levels of indirection from 'int'
p12_kiss.c
var polygon = child.get_polygon() # Replace with the new vector2array that you want to set
var polygonShape = ConcavePolygonShape2D.new()
var segments = Array()
segments.resize(polygon.size() * 2)
for i in range(polygon.size()):
segments[(i << 1) + 0] = polygon[i]
segments[(i << 1) + 1] = polygon[(i + 1) % polygon.size()]
// Public domain - Alexander Taylor
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour {
public Transform player;
public float speed;
bool isDragging = false;
(cond
((>= 24 emacs-major-version)
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
;;(package-refresh-contents)
)
)
@Giacom
Giacom / ViewAtlasSize.cs
Created March 1, 2016 17:04
A Unity Editor script to list all the atlases in your project and to show their file sizes when built.
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEditor.Sprites;
using System.Collections.Generic;
using System;
[ExecuteInEditMode]
public class ViewAtlasSize : EditorWindow {
@Giacom
Giacom / create_spritesheet.py
Created January 21, 2016 12:30
Compiles a list of images, with the same width and height, into a single spritesheet.
from PIL import Image
from tqdm import tqdm
import argparse
import math
# Constants for bounding boxes
left = 0
top = 1
right = 2
bottom = 3
@Giacom
Giacom / RichText.cs
Last active October 23, 2015 10:27
This class was designed to be used in a dialog system where text is printed on screen one character at a time. A problem I had ran into is that if you used Unity's RichText, such as for colouring text, then you would need to find a way to have the text become coloured as they print, as Unity will show the tags until the ending tag is printed.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
/**
* Class used to parse string as RichText.
* WARNING: This does not use recursion and will not detect tags within tags.
* ANOTHER WARNING: It will think anything with a < is a tag so don't use them.
* FINAL WARNING: I made this in a day as I needed something quick and which suited the game's needs. Expect large chunks of code.