Skip to content

Instantly share code, notes, and snippets.

View dechowdev's full-sized avatar
🚴‍♂️
Office working!

Lucas Dechow dechowdev

🚴‍♂️
Office working!
View GitHub Profile
@jdah
jdah / wfc.hpp
Created August 5, 2022 15:18
Wave Function Collapse
#pragma once
#include "util/types.hpp"
#include "util/std.hpp"
#include "util/ndarray.hpp"
#include "util/collections.hpp"
#include "util/rand.hpp"
#include "util/hash.hpp"
#include "util/assert.hpp"
#include "util/bitset.hpp"
@barnybug
barnybug / docker-compose.yml
Created November 21, 2017 11:14
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@nicoplv
nicoplv / PlayFromScene.cs
Last active June 20, 2018 13:14
Editor script to make Play button always start a main scene in Unity 3D (works only with 2017.2 or +)
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace SmartEditors
{
[InitializeOnLoad]
public class PlayFromScene : Editor
{
[MenuItem("Tools/Editor/Play From Scene/Set Main Scene", false, 0)]
@LotteMakesStuff
LotteMakesStuff / InspectorButtonsTest.cs
Last active November 2, 2023 21:03
Code running pack! two property drawing scripts that make it super easy to trigger code via buttons in the inspector, and get feedback! [TestButton] draws you little buttons that call a method on your MonoBehaviour, and [ProgressBar] give you a great way to show feedback from long running methods. These are *super* helpful for things like proced…
using UnityEngine;
using System.Collections;
public class InspectorButtonsTest : MonoBehaviour
{
[TestButton("Generate world", "DoProcGen", isActiveInEditor = false)]
[TestButton("Clear world", "ClearWorld", 2, isActiveInEditor = false)]
[ProgressBar(hideWhenZero = true, label = "procGenFeedback")]
public float procgenProgress = -1;
@orgmir
orgmir / PauseFreeCamera.cs
Last active November 11, 2017 00:39
Unity script to pause the game and adjust the camera freely
using UnityEngine;
using System.Collections;
// Script taken from https://www.reddit.com/r/Unity3D/wiki/screenshots
public class PauseFreeCamera : MonoBehaviour {
float turnSpeed = 2.0f; // Speed of camera turning when mouse moves in along an axis
float panSpeed = 1.0f; // Speed of the camera when being panned
float zoomSpeed = 1.0f; // Speed of the camera going back and forth
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public static class PivotUtilities
{
[MenuItem("GameObject/Pivot/Create Pivot", false, 0)]
static void CreatePivotObject()
{
@tejacques
tejacques / HOCBaseRender.tsx
Last active May 2, 2022 13:05
React Higher Order Components in TypeScript
import * as React from 'react';
import { Component } from 'react';
export default function HOCBaseRender<Props, State, ComponentState>(
Comp: new() => Component<Props & State, ComponentState>) {
return class HOCBase extends Component<Props, State> {
render() {
return <Comp {...this.props} {...this.state}/>;
}
}
@geraldfullam
geraldfullam / A-jQuery-plugin-deepest().markdown
Last active September 24, 2019 14:21
jQuery plugin: .deepest()

jQuery plugin: .deepest()

Get the deepest descendants matching an optional selector of each element in the set of matched elements.

A Pen by Gerald on CodePen.

License.

Installation

@ppalludan
ppalludan / Singleton-run-once
Last active August 29, 2015 14:15
Implemention of a "run once" function, so that I can invoke a given method like crazy, and the method is only invoked once
var Singleton = {
_threads : [],
process: function (name, callback) {
var evt = this._threads[name];
if (evt == null) {
evt = this._threads[name] = { name : name };
}
if (evt.running) {
evt.que = true;
return;