Skip to content

Instantly share code, notes, and snippets.

import flixel.FlxG;
class PixelateShader extends flixel.system.FlxAssets.FlxShader
{
var debug = false;
var enabled = true;
@:glFragmentSource('
#pragma header
@jcward
jcward / Client.hx
Last active January 17, 2024 04:04
A Quick Haxe Client / Server Socket Example
import sys.net.Host;
import sys.net.Socket;
class Client
{
public function new()
{
var args = Sys.args();
if (args.length==0) {
trace('Usage: Client <server ip / hostname>');
@brihernandez
brihernandez / SmoothDamp.cs
Last active April 28, 2025 07:35
Framerate independent damping
using UnityEngine;
// Thanks to Rory Driscoll
// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/
public static class SmoothDamp
{
/// <summary>
/// Creates dampened motion between a and b that is framerate independent.
/// </summary>
/// <param name="from">Initial parameter</param>
@superswan
superswan / UVPTK.md
Last active October 8, 2021 03:39
40hex #4 - Dec 1991: The Ultimate Virus Programmer's Toolkit

40Hex Issue 4 December 1991

The Ultimate Virus Programmers Toolkit


Just thought it would be funny to list what I think is the ulitmate virus programmers toolkit. Theroys may vary.
@kekru
kekru / git-copy-files-to-empty-branch.md
Last active February 26, 2024 05:51
git: Copy files to new branch without history, using a squash merge

Git: New branch with files but no history

This is how to copy your files from a given git branch to a new empty branch, using a squash merge.
This example will copy files from branch old-branch to target-branch

# First be sure, that you don't have uncommitted working changes. They will be deleted

# Checkout a new empty branch without history
git checkout --orphan target-branch
@Beeblerox
Beeblerox / CRTFilter
Created July 23, 2017 09:34
CRTFilter for OpenFl 5.0
package;
import openfl.Lib;
import openfl.display.Shader;
import openfl.filters.BitmapFilter;
import openfl._internal.renderer.RenderSession;
import openfl.geom.Point;
/**
* ...
@paulirish
paulirish / what-forces-layout.md
Last active May 16, 2025 01:11
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@hamaluik
hamaluik / ThreadPool.hx
Last active December 19, 2023 09:59
Platform-agnostic thread pool for Haxe / OpenFL
package com.blazingmammothgames.util;
#if neko
import neko.vm.Thread;
import neko.vm.Mutex;
#elseif cpp
import cpp.vm.Thread;
import cpp.vm.Mutex;
#end
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">