Skip to content

Instantly share code, notes, and snippets.

View adekbadek's full-sized avatar

Adam Cassis adekbadek

View GitHub Profile
module.exports = function(grunt) {
// most basic Grunt config with just livereloading
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
html: {
files: 'index.html',
<!-- DEVELOPMENT -->
<script type="text/javascript" src="js/script.js" ></script>
<!-- END DEVELOPMENT -->
<!-- PRODUCTION
<script type="text/javascript" src="js/script.min.js"></script>
END PRODUCTION -->
module.exports = function(grunt) {
grunt.initConfig({
// (...)
copy:{
// (...)
options: {
process: function (content) {
content = content.replace(/<!-- DEVELOPMENT -->\s*.*\s*<!-- END DEVELOPMENT -->/g,'');
content = content.replace(/<!-- PRODUCTION\s*(.*)\s*END PRODUCTION -->/g, '$1');
return content;
@adekbadek
adekbadek / showedgecollider.cs
Last active December 30, 2023 19:02
Show 2D Edge Collider as Gizmo, also in Edit Mode
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class visibleCollider : MonoBehaviour {
// The Collider itself
private EdgeCollider2D thisCollider;
// array of collider points
private Vector2[] points;