Skip to content

Instantly share code, notes, and snippets.

View geetfun's full-sized avatar

Simon Chiu geetfun

View GitHub Profile
var count = 1;
var showHelloWorld = function(count) {
var resource = Template.call(this, count);
var parser = new DOMParser();
var doc = parser.parseFromString(resource, "application/xml");
doc.addEventListener("select", function() {
count += 1;
var oldDoc = doc;
var newDoc = showHelloWorld(count)
<?xml version="1.0" encoding="UTF-8" ?>
<document>
<alertTemplate>
<title>YOLO!</title>
<description>Are you sure?</description>
<button>
<text>Yes</text>
</button>
<button>
<text>No</text>
App.onLaunch = function(options) {
var templateURL = 'http://localhost:9001/templates/alert.tvml';
function getDoc(url) {
var request = new XMLHttpRequest();
request.responseType = "application/xml";
request.addEventListener("load", function() {
navigationDocument.pushDocument(request.responseXML)
}, false);
request.open("GET", url, true);
import UIKit
import TVMLKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, TVApplicationControllerDelegate {
var window: UIWindow?
var appController: TVApplicationController?
<alertTemplate>
<title>This is the title</title>
<description>This is the description</description>
<button>
<text>This is the button text</text>
</button>
</alertTemplate>
var b = new CustomBinding();
var sec = (AsymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10);
sec.EndpointSupportingTokenParameters.Signed.Add(new UserNameSecurityTokenParameters());
sec.MessageSecurityVersion =MessageSecurityVersion.
WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10;
sec.IncludeTimestamp = true;
sec.MessageProtectionOrder = System.ServiceModel.Security.MessageProtectionOrder.SignBeforeEncrypt;
sec.EnableUnsecuredResponse = true;
b.Elements.Add(sec);
@geetfun
geetfun / nginx.conf.erb
Created November 19, 2014 06:09
Ruby shell script to generate nginx.conf from docker containers
upstream propertypub {
<% ip_addresses_for_web_containers.each do |ip_address| %>
server <%= ip_address %>:80;
<% end %>
}
@geetfun
geetfun / gist:5908992
Created July 2, 2013 12:47
Inverted rounded CSS corners
#transaction-toggler li {
background-color: #f2f2f2;
display: inline-block;
position: relative;
padding: 2px 10px;
}
#transaction-toggler li:before,
#transaction-toggler li:after,
#transaction-toggler li a:before,
App.AccountEditRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', this.get('currentUser'));
}
});
@geetfun
geetfun / Retinafy.md
Created July 24, 2012 02:38 — forked from nijikokun/Retinafy.md
Retinafy your site, a free book

Retinafy Your Site / Device

By Nijiko Yonskai

=====

I made a book, its one page.

Why Use Larger Images?

Higher resolution, twice the size, more detail, better experience on a device that provides it. There is also that thing where people make the desktop version and go to mobile more often than they do the reverse, why? Because, people like making complicated stuff first.