This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Adds logging to all functions in a JS object. | |
/// | |
/// Backbone usage example: | |
/// return Backbone.View.extend({ ... }); | |
/// becomes: | |
/// return Backbone.View.extend(addLogs({ ... })); | |
/// and all method invocations are now logged to the console. | |
/// | |
function addLogs(obj) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd "$(dirname "${BASH_SOURCE[0]}")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Run from the project root. Pass the full name of a script, or substring of the names of the scripts to check. | |
# | |
# Example | |
# $) ./findrefs.sh BackgroundCamera | |
# Finding matches for script Assets/Scripts/Camera/BackgroundCamera.cs.meta ... | |
# Assets/Prefabs/CaveBGCamera.prefab: m_Script: {fileID: 11500000, guid: 7e63acfee367c4314852b87218149bd3, type: 3} | |
# Assets/Prefabs/ForestBGCamera.prefab: m_Script: {fileID: 11500000, guid: 7e63acfee367c4314852b87218149bd3, type: 3} | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class BumperZapper : MonoBehaviour | |
{ | |
Rigidbody2D _rb; | |
void Awake() | |
{ | |
_rb = GetComponent<Rigidbody2D>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "$1" | fold -w 1 | sort | tee /tmp/struniq | uniq | cmp -s - /tmp/struniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="paper" width="1024" height="768"></canvas> | |
<script> | |
// --------------------------------------------------------------------------- | |
var canvas = document.getElementById("paper"); | |
var ctx = canvas.getContext("2d"); | |
var mouse = {}, keys = {}; | |
canvas.addEventListener('mousemove', function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections.Generic; | |
public class CubicSplineWalker | |
{ | |
readonly Vector2 _anchor0; | |
readonly Vector2 _control0; | |
readonly Vector2 _control1; | |
readonly Vector2 _anchor1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Xml; | |
using UnityEditor; | |
using UnityEngine; | |
public class StarlingAtlasSlicer | |
{ | |
[MenuItem("CONTEXT/TextureImporter/Slice Sprite Using XML")] | |
static public void SliceUsingXML(MenuCommand command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /Applications/Google\ Drive.app/Contents/Resources | |
for file in $(find . -depth 1 | grep 'inverse.*png'); do | |
echo "Fixing $file ..." | |
cp "$file" "$(printf "$file" | sed 's/-inverse//')" | |
done | |
echo 'Done!' |