Skip to content

Instantly share code, notes, and snippets.

package;
import flash.display.Sprite;
import flash.geom.Point;
import openfl.events.JoystickEvent;
#if android
import openfl.utils.JNI;
import tv.ouya.console.api.OuyaController;
var tabbableElements = 'a[href], area[href], input:not([disabled]),' +
'select:not([disabled]), textarea:not([disabled]),' +
'button:not([disabled]), iframe, object, embed, *[tabindex],' +
'*[contenteditable]';
var keepFocus = function (context) {
var allTabbableElements = context.querySelectorAll(tabbableElements);
var firstTabbableElement = allTabbableElements[0];
var lastTabbableElement = allTabbableElements[allTabbableElements.length - 1];
// +build !appengine
package main
/*
* Usage: ./TinyGCMServer <API_KEY> <Server URL(:port)>
* Test: curl -d "<NOTIFICATION MESSAGE>" http://serverURL/sendMessage?target=<REGISTRATION_ID>
*/
import (
"fmt"
gcm "github.com/googollee/go-gcm"
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
$ = jQuery
$.support.touch or= ('ontouchstart' of window)
# Helper functions
parentIfText = (node) ->
if 'tagName' of node then node else node.parentNode
swipeDirection = (x1, x2, y1, y2) ->
xDelta = Math.abs(x1 - x2)
// Example:
JavaScript.load("/javascripts/something.js");
// With callback (that’s the good thing):
JavaScript.load("http://www.someawesomedomain.com/api.js", function() {
API.use(); // or whatever api.js provides ...
});
<?php
$diff_file = file('diff.txt');
$count = 1;
$diff_data = array();
foreach ($diff_file as $row) {
if (strpos($row, 'diff --git') !== false) {
$count = 1;
}
/**
* Copyright (c) 2013 Amos Laber
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
package {
import com.bit101.components.PushButton;
import com.bit101.components.TextArea;
import com.codeazur.as3swf.SWF;
import com.codeazur.as3swf.tags.*;//TagPlaceObject;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;