Skip to content

Instantly share code, notes, and snippets.

View bennage's full-sized avatar
📺
please stay tuned

Christopher Bennage bennage

📺
please stay tuned
View GitHub Profile
@MattRix
MattRix / CurvatureImageEffect.shader
Last active February 2, 2024 20:15
Cavity/Curvature image effect shader based on the Blender node graph in this post: https://blender.community/c/rightclickselect/J9bbbc/
Shader "Milkbag/CurvatureImageEffect"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_LightStrength ("LightStrength", Float) = 0.3
_DarkStrength ("DarkStrength", Float) = 0.3
_Spread ("Spread", Float) = 1.0
[Toggle(USE_MULTIPLY)] _UseMultiply("Use Multiply", Float) = 0
[Toggle(CURVATURE_ONLY)] _CurvatureOnly("Curvature Only", Float) = 0
@ditzel
ditzel / ScrollAndPinch.cs
Created July 22, 2019 17:12
Pinch and Scroll to Move and Zoom in Unity for Mobile Games
/*
Set this on an empty game object positioned at (0,0,0) and attach your active camera.
The script only runs on mobile devices or the remote app.
*/
using UnityEngine;
class ScrollAndPinch : MonoBehaviour
@leebyron
leebyron / es6_import.js
Last active August 29, 2015 14:13
ES6 import -> CJS example
import * as foo from "foo"
var $foo = require("foo");
var foo = $foo;
import foo from "foo"
var $foo = require("foo");
var foo = $foo.default;
import { foo } from "foo"
var $foo = require("foo");
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@bennage
bennage / sliding_window.cs
Last active August 29, 2015 14:02
is there an Rx method that already does this?
namespace RxTest
{
using System;
using System.Collections.Generic;
using System.Linq;
using Chunk = System.Collections.Generic.List<int>;
internal class Program
{
@bennage
bennage / ideas.md
Last active August 29, 2015 14:02
What questions do you have about participating in open source?

Are you new to open source? What sort of questions, concerns, or even fears do you have?

Culture

  • How do I start contributing to other projects?
  • How can I encourage contribution to my project?
  • Who should have commit rights?
  • What commitment am I making by opening my source?
  • How do I establish a community?
  • What expectations will the community have?
@bennage
bennage / alias.cs
Created March 10, 2014 23:10
making tuples a little easier to work with
namespace AliasFun
{
using MyRecord = System.Tuple<string, int>;
public class AnExample
{
public void Demonstrating()
{
var record = new MyRecord("thing", 42);
}
@mathias-brandewinder
mathias-brandewinder / gist:5558573
Last active October 31, 2023 05:05
Stub for F# Machine Learning Dojo
// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier
@mattpodwysocki
mattpodwysocki / quicksort.js
Last active July 15, 2017 17:57
Implementation of QuickSort using ES6 features
// Using comprehensions
function sort(arr) {
var pivot, t;
if (arr.length === 0) {
return [];
}
[pivot, t] = [arr[0], arr.slice(1)];
return sort([x for (x of t) if x < pivot])
.concat(pivot)
.concat(sort([x for (x of t) if x >= pivot]));
@domenic
domenic / launcher.cpp
Created November 6, 2012 22:23
Programmatically running a Windows 8 Metro app
#include <SDKDDKVer.h>
#include <ShObjIdl.h>
#include <tchar.h>
int wmain(int argc, wchar_t* argv[])
{
const wchar_t* appId = L"WinningJS-test-runner_aw9cjjms6ptaw!App";
CoInitialize(nullptr);
IApplicationActivationManager* aam = nullptr;