Skip to content

Instantly share code, notes, and snippets.

@abberg
abberg / volumetricLight.js
Last active April 30, 2020 15:05
Example of three.js setup for volumetric lighting
var scene, camera, renderer, composer, box, pointLight,
occlusionComposer, occlusionRenderTarget, occlusionBox, lightSphere,
angle = 0,
DEFAULT_LAYER = 0,
OCCLUSION_LAYER = 1;
// scene, camera, and renderer as normal for three.js
scene = new THREE.Scene();
@alexrainman
alexrainman / ITextMeter
Last active August 1, 2022 07:45
Calculate Xamarin.Forms label height by amount of text
namespace YourNamespace
{
public interface ITextMeter
{
double MeasureTextSize(string text, double width, double fontSize, string fontName = null);
}
}
@joinAero
joinAero / FlymeUtils.java
Created February 17, 2016 13:04
Android - Helper for 3rd party roms: Flyme & MIUI.
package cc.cubone.turbo.core.rom;
import android.os.Build;
import android.view.Window;
import android.view.WindowManager;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
@joinAero
joinAero / TransparentStatusBarActivity.java
Last active September 24, 2022 13:24
Android - Completely transparent status bar.
package cc.cubone.turbo.ui.demo;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.ColorInt;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
@snipsnipsnip
snipsnipsnip / rewrite-author.sh
Created December 23, 2013 20:53
a commit filter for a git-svn'd repository (maps author and removes git-svn id but revision number)
git filter-branch --commit-filter '
case "$GIT_AUTHOR_NAME" in
*suzuki*)
GIT_AUTHOR_NAME="suzu"
GIT_AUTHOR_EMAIL="suzu@example.com"
;;
*)
GIT_AUTHOR_NAME="someone"
GIT_AUTHOR_EMAIL="someone@example.com"
;;