Skip to content

Instantly share code, notes, and snippets.

View timrwood's full-sized avatar

Tim Wood timrwood

View GitHub Profile
@timrwood
timrwood / router.js
Created December 18, 2012 21:30
router.js
define([
"rosy/views/Router",
"mysite/views/Home",
"mysite/views/About",
"mysite/views/Contact"
],
function (Router, Home, About, Contact) {
var group = new Router({
@timrwood
timrwood / shortcuts.txt
Created December 11, 2012 20:56
Blender Shortcuts
UI
T - hide/show tools
N - hide/show properties
@timrwood
timrwood / errors.html
Created November 30, 2012 01:54
Tracking js errors in Rosy
<script>
require(["$"], function ($) {
define("jquery", $)
require(["__projectname__/Site"], function (Site) {
try {
Site.initialize();
} catch (e) {
// log errors
}
.stylie {
animation-name: stylie-transform-keyframes;
animation-duration: 2000ms;
animation-delay: 0ms;
animation-fill-mode: forwards;
animation-timing-function: linear;
}
@keyframes stylie-transform-keyframes {
0% {transform:translateX(40px) translateY(519px) rotate(0deg);}
1% {transform:translateX(40.0722px) translateY(519.039px) rotate(0deg);}
@timrwood
timrwood / fromTodayCalendarElse.js
Created November 8, 2012 22:55
Combining calendar and from
moment.fn.fromTodayCalendarElse = function () {
var isSameDay = +this.clone().startOf('day') === +moment().startOf('day');
if (isSameDay) {
return this.fromNow();
} else {
return this.calendar();
}
}
@timrwood
timrwood / a.txt
Created November 8, 2012 01:20
Outstanding langs for week tests
ro 1 romanian
ru 1 russian
sl 1 slovenian
tr 1 turkish
1 - Monday is the first day of week.
Week containing Jan 1st is the first week of that year.
https://github.com/timrwood/moment/pull/503
http://www.pjh2.de/datetime/weeknumber/wnd.php
@timrwood
timrwood / args.js
Created November 5, 2012 22:27
Changing args
function changeArgs (args) {
args[0] = 'hello';
args[1] = "is it me you're looking";
args[2] = 4;
}
function lionel(a, b, c) {
console.log(a, b, c);
changeArgs(arguments);
console.log(a, b, c);
@timrwood
timrwood / bookmark.js
Created October 29, 2012 19:27
Omniture Tracking
javascript:void(window.open("","dp_debugger","width=600,height=600,location=0,menubar=0, status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script id=dbg src='http://www.digitalpulse.omniture.com/dp/debugger.js'></script>"));
@timrwood
timrwood / superstatic.js
Created October 24, 2012 21:59
Static Soup
(function(){
"use strict";
var a = {
super : "super",
static : "static"
}
var b = {
"super" : "super",
"static" : "static"