Skip to content

Instantly share code, notes, and snippets.

zeh fernando zeh

Block or report user

Report or block zeh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zeh
zeh / KeyActionBinder_create.as
Last active Dec 21, 2015
KeyActionBinder examples
View KeyActionBinder_create.as
// Creating a KeyActionBinder instance with some bindings
// Declarations ---------
// Action constants for easy use
private static const ACTION_LEFT:String = "left";
private static const ACTION_RIGHT:String = "right";
private static const ACTION_JUMP:String = "jump";
// In your game start ---------
@zeh
zeh / DreamyZoom.glsl
Last active Aug 29, 2015 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
View DreamyZoom.glsl
#ifdef GL_ES
precision highp float;
#endif
// Definitions --------
#define DEG2RAD 0.03926990816987241548078304229099 // 1/180*PI
// Hardcoded parameters --------
@zeh
zeh / DoomScreenTransition.glsl
Created May 23, 2014 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
View DoomScreenTransition.glsl
#ifdef GL_ES
precision highp float;
#endif
// Hardcoded parameters --------
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
View unity_keyboard_overlay.cs
// On Android, every Activity can respond differently to the software keyboard: scrolling to fit, just resizing, overlaying, etc.
// http://developer.android.com/training/keyboard-input/visibility.html
// The C# code below adjusts Unity's current Android Activity to make the keyboard overlay the game, with no size adjustments.
// It is equivalent to calling getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING) in Java.
// Helped method needed for proper UI thread calls (required when accessing context views)
private static void runOnAndroidUiThread(Action target) {
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
using (var activity = unityPlayer.GetStatic("currentActivity")) {
activity.Call("runOnUiThread", new AndroidJavaRunnable(target));
View SafetyScrollChecker
/**
* Validate the scroll position on a container
* This is used to prevent overscrolling on iOS, and avoid flickering (which only happens from the edges)
* It does so by limiting the scroll inside an element to 1..(max-1) instead of 0..max, since attempts to scroll
* an element already at its scrolling ends will scroll the parent instead.
*
* Usage:
* let checker = new SafetyScrollChecker(document.querySelector(".someclass"));
* checker.stop(); // If you want to allow any scrolling
* checker.start(); // Start blocking again
View AspectRatioDiv.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
interface IProps {
className?: string;
ratio: number;
style?: Object;
type?: ScaleType;
}
View ANSIColorUtils.ts
/*
Converts ANSi Art source text to console.log()-compatible color codes that work on Chrome and FireFox.
Usage:
console.log.apply(null, ANSIColorUtils.convertToConsole(ansiSource:string, numColumns:number));
Example:
console.log.apply(null, ANSIColorUtils.convertToConsole(`

View react-navigation-modal.md

Idea

#127 "ScrollView in modal prevents modal from dismissing sometimes" - https://github.com/react-navigation/stack/issues/127

This issue has a good discussion and a comment:

brentvatne: it's not really possible for react-navigation to guess when you may or may not want to close the modal depending on other gestures you have inside of a scene, you need to define that behavior for yourself. you can access the gesture context like this: https://github.com/react-navigation/react-navigation-stack/blob/5f157cbc16f2dd15363304ab3c78663b0ed36de0/example/src/GestureInteraction.js#L55-L56 then you can use react-native-gesture-handler tools to make this behave how you like.

You can’t perform that action at this time.