Skip to content

Instantly share code, notes, and snippets.

@keller
keller / kate_birthday.coffee
Created January 28, 2012 04:27
Birthday Card for Kate
sing = (lyric, song) ->
lines = (song.line(i, lyric) for i in [0...song.length])
full_song = lines.join(",\n")+"!"
alert full_song
birthday =
length: 4
line: (line, lyric) ->
lyric + if (line == 2) then " birthday, dear #{@name}" else " birthday to you"
to: (@name) ->
@kamend
kamend / AssetProcessing.cs
Last active August 8, 2016 13:29
Unity: An example how to set different Texture options based on the import directory. Copy this in the Editor folder.
using UnityEngine;
using UnityEditor;
public enum TextureType {
NONE = -1,
GUI = 0,
CHARACTERS = 1
}
public class AssetProcessing : AssetPostprocessor {
// Sorting Layer Offset, for Unity sprites. By Jon Manning (@desplesda) at Secret Lab! http://secretlab.com.au
// This code is released under the CC-0 license. https://creativecommons.org/publicdomain/zero/1.0/
// You can do whatever you like with it, but neither I nor Secret Lab offer any support for it.
using UnityEngine;
using System.Collections;
// Shift all sorting layers based on Z position - the farther they are in Z,
// the lower their sorting order will be!
@cdzombak
cdzombak / git-google
Last active February 2, 2021 18:15
Shell script adding `git google *` to git subcommands. Put this file, named `git-google`, somewhere in your $PATH, and be sure to make this file executable. Then, type "git google commit," for example, to open a Google search for "git commit tutorial." Hacky AF, but it does generally work.
#!/usr/bin/env bash
set -e
urlencode() {
# from https://gist.github.com/cdown/1163649
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C