Skip to content

Instantly share code, notes, and snippets.

git checkout master
@crilleengvall
crilleengvall / rename
Last active August 29, 2015 14:01
Git rename branch
git branch -m <oldbranchname> <newbranchname>
example:
git branch -m feature/humanreadable feature/translation
@crilleengvall
crilleengvall / StartCoroutine.cs
Last active August 29, 2015 14:17
StartCoroutine and StopCoroutine
using UnityEngine;
using System.Collections;
public class EnvironmentSpawner : MonoBehaviour {
public GameObject LargeCloud;
void Start() {
StartCoroutine(SpawnLargeClouds());
}
8368 10:31:54 ERROR Application error.
Exception: System.ArgumentOutOfRangeException
Message: The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
Source: mscorlib
at System.DateTimeOffset..ctor(DateTime dateTime)
at Sitecore.Resources.Media.Streaming.Preconditions.IfRangePrecondition.CheckRequestPreconditionAndSetResponseStatus(HttpContext context)
at Sitecore.Resources.Media.Streaming.RangeRetrievalResponse.ExecuteRequest(HttpContext context)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context, MediaRequest request, Media media)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context)
@crilleengvall
crilleengvall / StuckSheepCheck.cs
Last active August 29, 2015 14:22
How to check if a game object has stopped moving
using UnityEngine;
using System.Collections;
public class StuckSheepCheck : MonoBehaviour {
public GameObject Sheep;
public GameObject SheepTwo;
private Rigidbody2D SheepRigidbody2D;
private Rigidbody2D SheepTwoRigidbody2D;
@crilleengvall
crilleengvall / googlemap.html
Created February 15, 2012 12:53
Adding markers to google map...
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Simple Icons</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize()
@crilleengvall
crilleengvall / relatePlusSV.xml
Created April 18, 2012 11:54
Episerver Relate Demo site translation in swedish
<?xml version="1.0" encoding="utf-8"?>
<languages>
<language name="Swedish" id="sv">
<pagetitles>
<images>bilder</images>
<imagegalleries>bildgalleri</imagegalleries>
<myblog>blog</myblog>
<myfriends>vänner</myfriends>
<mypage>sida</mypage>
</pagetitles>
@crilleengvall
crilleengvall / embed-gist.php
Created June 24, 2012 11:46 — forked from roborourke/embed-gist.php
Adds autoembedding of gist urls in WordPress
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@crilleengvall
crilleengvall / after
Created July 26, 2012 09:07
#import directives
#import "DevicesViewController.h"
#import "FSVerticalTabBarController.h"
#import "SensorsViewController.h"
#import <Foundation/Foundation.h>
@crilleengvall
crilleengvall / gist:3697074
Created September 11, 2012 09:03
Check if page in episerver is opened in editmode/adminmode
private bool IsOpenedInEditMode()
{
bool isInEditMode = false;
If(HttpContext.Current.Request.UrlReferrer != null)
{
isInEditMode = Regex.IsMatch(HttpContext.Current.Request.UrlReferrer.LocalPath, "/admin/|/edit/", RegexOptions.IgnoreCase);
}
return isInEditMode;
}