Skip to content

Instantly share code, notes, and snippets.

View Zielak's full-sized avatar
💾
ヾ(⌐■_■)ノ♪

Darek Greenly Zielak

💾
ヾ(⌐■_■)ノ♪
View GitHub Profile
@getify
getify / 1.js
Last active January 9, 2018 08:26
horribly convoluted bug, badly illustrated. **NOTE: this is not the real code, it's an ugly illustration of kinda what the bug was in my real code.
var y;
foo();
// values: 3 10
// value: 4 10
// *******************************
function foo() {
for (let i=0; i<2; i++) {
let obj = { x: 2 }; // <-- bug because of `let` here
@mchirico
mchirico / twotableviewsInOneView.swift
Last active June 5, 2023 08:47
Creating multiple tableViews in one ViewController...this just starts out as a view controller
//
// ViewController.swift
// Delete
//
// Created by Mike Chirico on 10/21/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
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
@AndreiRudenko
AndreiRudenko / SpatialHash.hx
Last active May 13, 2019 19:01
SpatialHash uniform-grid implementation
// SpatialHash uniform-grid implementation
// Broad-phase algorithm for collision detection
// Andrei Rudenko // SpatialHash.hx (24.07.2016)
import luxe.Vector;
import luxe.utils.Maths;
class SpatialHash {
public var min(default, null):Vector;
@KeyMaster-
KeyMaster- / PlyImporter.hx
Last active August 29, 2015 14:08
Importer for PLY files from Blender into Luxe
package;
import luxe.Mesh;
import haxe.io.StringInput;
import luxe.options.MeshOptions;
import luxe.Vector;
import phoenix.Batcher;
import phoenix.geometry.Geometry;
import PlyParser;
import phoenix.geometry.Vertex;
/**
@anissen
anissen / luxe_resources.md
Last active August 29, 2015 14:07
Luxe resources
{
"folders":
[
{
"follow_symlinks": true,
"name": "PROJECT NAME",
"path": "/project/path"
},
{
"follow_symlinks": true,
@AbelToy
AbelToy / Gradient.hx
Last active August 29, 2015 14:07
Luxe Gradient Component
package;
import luxe.Color;
import luxe.Component;
import luxe.Sprite;
/**
* This will set the color of any Sprite to a gradient.
*
* @author Abel Toy
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active March 28, 2024 22:25
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//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, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in
@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then