Skip to content

Instantly share code, notes, and snippets.

View PixalizationRenderFeature.cs
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class PixalizationRenderFeature : ScriptableRendererFeature
{
class PixalizationRenderPass : ScriptableRenderPass
{
PixalizationRenderFeature _parent;
@m039
m039 / BT.cs
Created Aug 11, 2019
The Behavior Tree source code file from Unity's 2D Game Kit project.
View BT.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BTAI
{
public enum BTState
{
Failure,
Success,
@m039
m039 / Final.cs
Last active Mar 2, 2017
C# structs and classes as wrappers, performance benchmark
View Final.cs
using System;
using System.Diagnostics;
namespace VoidSharedProject
{
// Results:
// 1: 00:00:47.3721840
// 2: 00:01:14.6771620
View spacemacs-gyp-layer.el
;;; packages.el --- gyp layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Dmitry Mozgin <m039@Dmitrys-MBP>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
@m039
m039 / Bar.hpp
Last active Feb 14, 2017
Issue when using empty namespace in CppSharp
View Bar.hpp
#pragma once
#include "IBar.hpp"
// Bar hosts IBar
class Bar {
public:
IBar *impl;
@m039
m039 / 37.1.rkt
Last active Jan 28, 2017
Exercise 37.1 form the HtDPv1 book. A little bit overdone though.
View 37.1.rkt
#lang racket/gui
;;; Exercise 37.1 from the HtDP book. A little bit overdone.
;;;
;;; GUI related functions
;;;
(define (create-frame title size draw-callback on-event-handler)
(define custom-canvas%
@m039
m039 / TouchController.cs
Last active Jan 25, 2017
Very easy implementation to handle basic horizontal and vertical swipes for Unity on mobile devices
View TouchController.cs
/// <summary>
/// TouchController allows you to handle basic swipes (left, right, top, bottom) on mobile device.
///
/// Usage: extend this class and don't forget to call Update in MonoBehaviour.Update
/// <summary>
public abstract class TouchController {
private readonly float _swipeThreshold;
private Vector2 _firstPosition;
@m039
m039 / gist:8384823
Created Jan 12, 2014
android stuff
View gist:8384823
# clean application data
adb shell pm clear com.android.browser
View get-username.rkt
;; Playing with racket
(require net/url)
(require json)
(require rnrs/io/ports-6)
(define link "http://graph.facebook.com/")
(define (get-username id)
(let ((ht (call-with-port (get-pure-port (string->url (string-append link id)))
(lambda (p)
@m039
m039 / MemoryAccountContentProvider.java
Created Sep 13, 2013
Custom ContentProvider example, based on memory array (android)
View MemoryAccountContentProvider.java
/** WTFContentProvider.java ---
*
* Copyright (C) 2013 Mozgin Dmitry
*
* Author: Mozgin Dmitry <flam44@gmail.com>
*
*
*/
package com.m039.example.provider;