Skip to content

Instantly share code, notes, and snippets.

@ClintChil
ClintChil / StringManipulation.cs
Last active September 24, 2018 17:59
String Manipulaiton Practice
using System;
// To execute C#, please define "static void Main" on a class
// named Solution.
class Solution {
static string ReverseString(string inputString) {
if (inputString.Length <= 1)
return inputString;
using UnityEngine;
using UnityEditor;
/// <summary>
/// Scene auto loader.
/// </summary>
/// <description>
/// This class adds a File > Scene Autoload menu containing options to select
/// a "master scene" enable it to be auto-loaded when the user presses play
/// in the editor. When enabled, the selected scene will be loaded on play,
How to setup UnityYAMLMerge.exe on Git for Windows
add "C:\Program Files\Unity\Editor\Data\Tools\" to your path in Windows
git config --global merge.tool unityyamlmerge
git config --global mergetool.unityyamlmerge.cmd 'unityyamlmerge.exe merge -p "$(cygpath -wla $BASE)" "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)" "$(cygpath -wla $MERGED)"'
git config --global mergetool.unityyamlmerge.trustExitCode false
This makes merging .scene files a breeze.
@ClintChil
ClintChil / NowThatsWhatICallMusicJSONurl
Last active October 24, 2015 18:47
Now That's What I Call Music! JSON Data
https://api.discogs.com/labels/266110/releases?per_page=100
#!/bin/bash -e
# requires ImageMagick! Install via homebrew, http://brew.sh
# brew install imagemagick
# Ensure we're running in location of script.
cd "`dirname $0`"
for f in *; do
if [[ $f == *@3x* ]];
[[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillChangeFrameNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
NSDictionary *dict = [note userInfo];
NSValue *keyboardFrame = dict[UIKeyboardFrameEndUserInfoKey];
CGRect frame = [keyboardFrame CGRectValue];
NSNumber *duration = dict[UIKeyboardAnimationDurationUserInfoKey];
double durationDouble = [duration doubleValue];
[UIView animateWithDuration:durationDouble animations:^{
self.view.frame = CGRectMake(0, frame.origin.y - self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height);
}];
}];