Skip to content

Instantly share code, notes, and snippets.

View josescasanova's full-sized avatar
:octocat:

jose josescasanova

:octocat:
View GitHub Profile
var appController: TVApplicationController?
static let TVBaseURL = "http://localhost:9001/"
static let TVBootURL = "\(AppDelegate.TVBaseURL)js/application.js"
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let appControllerContext = TVApplicationControllerContext()
@josescasanova
josescasanova / gist:5cfd4ea9fa9755862196
Last active October 11, 2015 00:38
AppDelegrate.swift
//
// AppDelegate.swift
// hello world
//
// Created by Jose Casanova on 10/10/15.
// Copyright © 2015 Jose Casanova. All rights reserved.
//
import UIKit
import TVMLKit
App.onLaunch = function(options) {
var alert = createAlert("Hello World", "Welcome");
navigationDocument.presentModal(alert);
}
var createAlert = function(title, description) {
var alertString = `<?xml version="1.0" encoding="UTF-8" ?>
<document>
<alertTemplate>
<document>
<alertTemplate>
<title>An Error has occured.</title>
</alertTemplate>
</document>
cd ~/desktop
cd hello\ world
cd client
// I saved the app to the desktop and had named it "hello world" previously.
var Presenter = {
makeDocument: function(resource) {
if (!Presenter.parser) {
Presenter.parser = new DOMParser();
}
var doc = Presenter.parser.parseFromString(resource, "application/xml");
return doc;
},
modalDialogPresenter: function(xml) {
@josescasanova
josescasanova / pr.md
Created October 21, 2015 01:39 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

require 'rubygems'
require 'sinatra'
require 'twilio-ruby'
require './env' if File.exists?('env.rb')
account_sid = ENV['ACCOUNT_SID']
auth_token = ENV['AUTH_TOKEN']
Twilio.configure do |config|
config.account_sid = account_sid
HTML:
<p id="greeting">Hello World!</p>
CSS:
.normal { color : black; }
.exciting { color : red; }
JAVASCRIPT
var mother = { firstName: "Angelina",
lastName: "Jolie",
cook: function(meal) {
console.log("Tonight " + this.firstName + " " + this.lastName + " is cooking " + meal);
}
}
mother.cook("lasagna");// Tonight Angelina Jolie is cooking lasagna