Skip to content

Instantly share code, notes, and snippets.

View ptomasroos's full-sized avatar

Tomas Roos ptomasroos

View GitHub Profile
using System.Linq;
namespace ClassLibrary2
{
using System;
using System.Reflection;
using NUnit.Core;
using NUnit.Core.Extensibility;
using NUnit.Framework;
@ptomasroos
ptomasroos / install-sublime-text-2
Created December 3, 2013 13:15
Install sublime-text-2 properly on Fedora 19 with Gnome 3 icon
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ] TARGET VERSION
#
# TARGET Default target is "/usr/local".
# VERSION If not defined tries to get the build into the Sublime Text 2 website.
#
# OPTIONS
#
# -h, --help Displays this help message.
#
@ptomasroos
ptomasroos / install-ubuntu
Last active August 29, 2015 13:56
This installs ubuntu 12.04.* with the latest stuff according to my preferences
# usage
# curl -s https://gist.github.com/ptomasroos/8861534/raw/ | sudo sh
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install linux-headers-generic build-essential
# install chrome
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
@ptomasroos
ptomasroos / install-vmwaretools-ubuntu
Last active August 29, 2015 13:56
This installs vmwaretools on ubuntu and expecting the tools to be mounted via the GUI of vmware fusion / player
# usage curl -s https://gist.github.com/ptomasroos/8914609/raw/ | sudo sh
# !! make sure you have the vmware tools mounted all ready through the UI
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install linux-headers-generic build-essential
cd /media/VMware\ Tools/
sudo cp VM*.tar.gz /tmp
cd /tmp
// in a controller
// you can either update the collection directly or send
// a message in the LAZO.app dispatcher
// (you can use a controller dispatcher if you want to be more granular)
var socket = io();
var self = this;
var notifications = this.ctx.collections.notifications;
// three different approaches to re-rendering a badge count
socket.on('notification', function (msg) {
// backs user model
define(['lazoSyncher'], function (LazoSyncher) {
return LazoSyncher.extend({
authenticate: function (credentials, options) {
// authenticate user using credentials
// you can call options.success or options.error
// update the user model, auth token, etc.
}
define(['lazoApp'], function (App) {
'use strict;
return App.extend({
initialize: function (callback) {
var html = '<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--><html lang="en">';
LAZO.app.setHtmlTag(html);
LAZO.app.setBodyClass('some-class another-class');
// base controller
define(['lazoCtl'], function (Ctl) {
'use strict';
return Ctl.extend({
index: function (options) {
this.loadModel('session', {
success: function (model) {
@ptomasroos
ptomasroos / ServerRender
Last active August 29, 2015 14:07
Yahoo flux flow
https://www.websequencediagrams.com/
title First navigation
opt server response
Browser->Express: GET /url
Express->Context: executeAction(navigate({ path: /url }))
Context->NavigateAction: Invoke
NavigateAction->ModelStores: Dispatch 'CHANGE_ROUTE_SUCCESS'
@ptomasroos
ptomasroos / gist:8dc1cf21271f5c17cea1
Created January 21, 2015 09:49
Avoid extra request for fav.icon
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">