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
View CameraSprite.ts
import { Container, MIPMAP_MODES, SCALE_MODES, Sprite, Texture } from "pixi.js";
import SimpleSignal from "simplesignal";
import Config from "../../../config/Config";
import CameraUtils from "../../utils/CameraUtils";
import FaceTracker from "../../utils/FaceTracker";
import Box from "../shapes/Box";
export default class CameraSprite extends Container {


#127 "ScrollView in modal prevents modal from dismissing sometimes" -

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: then you can use react-native-gesture-handler tools to make this behave how you like.

View ANSIColorUtils.ts
Converts ANSi Art source text to console.log()-compatible color codes that work on Chrome and FireFox.
console.log.apply(null, ANSIColorUtils.convertToConsole(ansiSource:string, numColumns:number));
console.log.apply(null, ANSIColorUtils.convertToConsole(`

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 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 unity_keyboard_overlay.cs
// On Android, every Activity can respond differently to the software keyboard: scrolling to fit, just resizing, overlaying, etc.
// 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));
zeh / DoomScreenTransition.glsl
Created May 23, 2014 — forked from glslioadmin/TEMPLATE.glsl Transition (v1)
View DoomScreenTransition.glsl
#ifdef GL_ES
precision highp float;
// Hardcoded parameters --------
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
zeh / DreamyZoom.glsl
Last active Aug 29, 2015 — forked from glslioadmin/TEMPLATE.glsl Transition (v1)
View DreamyZoom.glsl
#ifdef GL_ES
precision highp float;
// Definitions --------
#define DEG2RAD 0.03926990816987241548078304229099 // 1/180*PI
// Hardcoded parameters --------
zeh /
Last active Dec 21, 2015
KeyActionBinder examples
// 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 ---------
You can’t perform that action at this time.