Skip to content

Instantly share code, notes, and snippets.

View z3nth10n's full-sized avatar
🏠
Working from home

Álvaro Rodríguez z3nth10n

🏠
Working from home
View GitHub Profile
@z3nth10n
z3nth10n / thim-language-filler.html
Created September 13, 2017 19:58
Thim-language filler (fill and translate your page with Eduma Theme from Thimpress.com)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gist langs</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
function parse_query_string(query) {
var vars = query.split("&");
var query_string = {};
@z3nth10n
z3nth10n / wordpress_serialize_fixer.php
Created September 17, 2017 00:15
Wordpress database serialize problem fixers
<?php
$file = @$_GET["file"];
if(empty($file))
die("You must specify a ?file value.");
function fixSerialized($error_serialized_data)
{
$fixed_serialized_data = preg_replace_callback ( '!s:(\d+):"(.*?)";!',
function($match) {
@z3nth10n
z3nth10n / Client.cs
Created January 14, 2018 17:49 — forked from leandrosilva/Client.cs
Asynchronous Client/Server Socket Example with C# (from MSDN library)
// Asynchronous Client Socket Example
// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Text;
// State object for receiving data from remote device.
// ==UserScript==
// @name SO_like_keyboards_shortcuts
// @namespace sputnick
// @include https://github.com/*
// @include https://gist.github.com/*
// @include https://*.slack.com/*
// @version 1
// @grant none
// ==/UserScript==
header._3AwwN {
background: linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #dd00f3);
background-size: 1800% 1800%;
-webkit-animation: rainbow 18s ease infinite;
-z-animation: rainbow 18s ease infinite;
-o-animation: rainbow 18s ease infinite;
animation: rainbow 18s ease infinite;
}
using Flurl.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace DotNetAssembly
{
internal static class FlurlExtensions
{
@z3nth10n
z3nth10n / TriangleUtils.cs
Last active December 12, 2018 01:28
TriangleUtils - Useful for triangle rasterizations (has several methods), this work should be done once, because Rasterization is a specialized task for GPUs
using System;
using UnityEngine;
namespace UnityEngine.Utilities.Drawing
{
// Uncomment this if you don't a an own implementation
/*public struct Point
{
public int x;
public int y;
@z3nth10n
z3nth10n / ThreadSafeBool.cs
Last active April 2, 2019 22:43
ThreadSafeBool
using System.Threading;
namespace GTAMapper.Extensions.Threading
{
/// <summary>
/// Thread safe enter once into a code block:
/// the first call to CheckAndSetFirstCall returns always true,
/// all subsequent call return false.
/// </summary>
public class ThreadSafeBool
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using UnityEngine;
namespace GTAMapper.Extensions.Threading
{
public class ConcurrentQueuedCoroutines<T>
{
using GTAMapper.Extensions.Threading;
using System;
using System.Collections;
using UnityEngine;
namespace GTAMapper.Extensions
{
public static class BatchedCoroutines
{
public static IEnumerator BatchCoroutines(