Skip to content

Instantly share code, notes, and snippets.

View steveliles's full-sized avatar

Steve Liles steveliles

View GitHub Profile
@danvk
danvk / sprite-custom-layer.tsx
Created October 1, 2019 18:00
Mapbox custom layer which renders multiple models in a THREE.js scene
import MapboxGL, {LngLatLike, MercatorCoordinate} from 'mapbox-gl';
import React, {useEffect, useState} from 'react';
import {withMap} from 'react-mapbox-gl/lib-esm/context';
import {FeatureCollection} from 'geojson';
import * as THREE from 'three';
import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader';
export interface SpritePaint {
gltfPath: string;
@steveliles
steveliles / VerticalViewPager.java
Last active December 23, 2019 23:34
A vertical-paging version of ViewPager - the existing implementations that I found did not work for me. This is a simple hack-up of the standard v4 support ViewPager to convert its horizontal behaviour to vertical.
package com.sjl.views;
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0