Skip to content

Instantly share code, notes, and snippets.

View bdecarne's full-sized avatar

Blaise de Carné bdecarne

View GitHub Profile
@bdecarne
bdecarne / geojson-conversion.sh
Created October 22, 2018 14:45 — forked from benbalter/geojson-conversion.sh
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@bdecarne
bdecarne / 0_reuse_code.js
Created January 18, 2016 16:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bdecarne
bdecarne / CircleFormation.cs
Created November 17, 2015 21:59
Unity : circle formation
using UnityEngine;
using System.Collections;
public class TestScript : MonoBehaviour {
public GameObject obj;
private int points;
private double radius;
private Vector3 center;
@bdecarne
bdecarne / ClickToMoveNavMeshAgent.cs
Created November 5, 2015 18:02
Unity : ClickToMoveNavMeshAgent
using UnityEngine;
using System.Collections;
public class ClickToMoveNavMeshAgent : MonoBehaviour {
private NavMeshAgent agent;
private Animator anim;
private object mTransform;
private Vector3 targetPosition;
@bdecarne
bdecarne / ProjectorAdditiveTint.shader
Last active November 5, 2015 17:59
Unity : UnitSelection
Shader "Projector/AdditiveTint" {
Properties {
_Color ("Tint Color", Color) = (1,1,1,1)
_Attenuation ("Falloff", Range(0.0, 1.0)) = 1.0
_ShadowTex ("Cookie", 2D) = "gray" {}
}
Subshader {
Tags {"Queue"="Transparent"}
Pass {
ZWrite Off
@bdecarne
bdecarne / CameraNavigation.cs
Last active November 5, 2015 18:01
Unity : CameraNavigation
using UnityEngine;
using System.Collections;
public class CameraLook : MonoBehaviour {
float minFov;
float maxFov;
float sensitivity;
int boundary; // distance from edge scrolling starts
int speed;
@bdecarne
bdecarne / ClickToInstantiate.cs
Created November 4, 2015 18:44
Unity : ClickToInstantiate
using UnityEngine;
using System.Collections;
public class ClickToInstantiate : MonoBehaviour
{
public GameObject obj;
// Use this for initialization
@bdecarne
bdecarne / ThirdPlayerCtrl.cs
Last active November 4, 2015 18:07
Unity : ThirdPlayerCtrl.cs
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public Animator anim;
public Rigidbody rbody;
private float inputH;
private float inputV;
@bdecarne
bdecarne / ClickToGo.cs
Last active November 4, 2015 18:43
Unity : click to go
using UnityEngine;
using System.Collections;
public class ClickToMove : MonoBehaviour {
public GameObject terrain;
public Rigidbody rbody;
public Animator anim;
Vector3 previousPosition;
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$