(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* | |
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 |
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 |
// 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 |
// 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])); |
#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; |
function tabname { | |
printf "\e]1;$1\a" | |
} | |
if [ x`type -t cd` == "xfunction" ]; then | |
# previously wrapped cd | |
eval $(type cd | grep -v 'cd is a function' | sed 's/^cd/original_cd/' | sed 's/^}/;}/' ) | |
else | |
# builtin | |
eval "original_cd() { builtin cd \$*; }" |
param( | |
[string]$server = "origin", | |
[string]$branch = "master" | |
) | |
$gitStatus = (Get-GitStatus) | |
if ($gitStatus -eq $null) { | |
write-error "Not in a Git repository." | |
} elseif ($gitStatus.HasUntracked -or $gitStatus.HasWorking -or $gitStatus.HasIndex) { |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- #### NOTE #### --> | |
<!-- To build with Mono's xbuild on bash, you must execute [`sudo install-nuget.sh`](https://gist.github.com/2595337) first. --> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | |
<!-- Windows specific commands --> |
# in ruby, nil is an instance of NilClass. we're monkeypatching NilClass at this point, which is a bad idea for a production app. | |
# but for this example, it gets the point across and should help you find a solution to what you want... maybe... | |
class NilClass | |
def method_missing(name, *args) | |
if respond_to? name | |
return name(*args) | |
else | |
puts "do something about #{name} being nil, here" | |
# this will forward the call to the original NilClass.method_missing |