Skip to content

Instantly share code, notes, and snippets.

View garyritchie's full-sized avatar

Gary Ritchie garyritchie

View GitHub Profile
@karl-
karl- / CleanUpWindow.cs
Created November 15, 2012 03:25
New interface for removing unused Unity assets
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections;
using System.Collections.Generic;
public class CleanUpWindow : EditorWindow
{
bool groupEnabled = true;
List<string> usedAssets = new List<string>();
@AngryLoki
AngryLoki / ies2cycles.py
Last active January 30, 2024 16:47
IES to Cycles addon for new nodetree system! It only works for trunk builds of blender 2.66 and later versions!!! Thread on blenderartists.org: http://blenderartists.org/forum/showthread.php?276063 Old outdated version (no rig) for official 2.66 release (old nodetrees): https://gist.github.com/Lockal/5313485
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@mojavelinux
mojavelinux / textile2asciidoc.rb
Last active September 13, 2019 12:43
A crude script to convert Textile documents to AsciiDoc. Some of the replacements are specific to markup that I use, but hopefully still useful.
#!/usr/bin/env ruby
if ARGV[0].nil?
$stderr.puts 'Must specify an input file'
exit 1
end
source = IO.read(ARGV[0])
title = nil
@jtdp
jtdp / gist:5443297
Last active July 16, 2024 14:40
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..
@shsteimer
shsteimer / gist:7257245
Created October 31, 2013 21:10
Tip to delete tags by pattern
#delete all the remote tags with the pattern your looking for, ie. DEV-
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/%
#delete all your local tags
git tag | xargs -n 1 -i% git tag -d %
#fetch the remote tags which still remain
git fetch
@zhenyanghua
zhenyanghua / code.gs
Created July 15, 2014 19:55
Googlemaps + Google Sheets + Google Forms
var SPREADSHEET_ID='Google Sheets ID';
var SHEET_NAME = 'Google Sheets Table Name';
function doGet(request) {
var callback = request.parameters.jsonp;
var range = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME).getDataRange();
var json = callback+'('+Utilities.jsonStringify(range.getValues())+')';
return ContentService.createTextOutput(json).setMimeType(ContentService.MimeType.JAVASCRIPT);
}
@pushandplay
pushandplay / Makefile Tricks
Created September 18, 2014 20:50
Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison
NUMBER1 := 10
NUMBER2 := 5
#Addition
ADD := $(shell echo ${NUMBER1}+${NUMBER2} | bc)
#Subtraction
SUBTRACT := $(shell echo ${NUMBER1}-${NUMBER2} | bc)
#Multiplication
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@ProGM
ProGM / find_useless_resources_unity.sh
Last active January 8, 2022 10:04
A useful script to identify Unity resource that are not referenced in the project
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m'
rm unused_files.log &> /dev/null
grep -r . --include=\*.meta --exclude=*{Editor,Gizmos}* -e 'guid' | while read line; do