Skip to content

Instantly share code, notes, and snippets.

View tbosch's full-sized avatar

Tobias Bosch tbosch

  • Google Inc.
  • Santa Clara / California / US
View GitHub Profile
@tbosch
tbosch / gist:9cefcc30196e00509036
Created May 26, 2015 23:36
clang-format/issues/11
export function main() {
describe("ElementInjector",
() => {
[{ strategy: 'inline', bindings: [] }, { strategy: 'dynamic', bindings: dynamicBindings }].forEach((context) => {
var extraBindings = context
['bindings'];
describe(`${context['strategy']} strategy`,
() => {
describe("lifecycle", () => {
it("should call onDestroy on directives subscribed to this event",
@tbosch
tbosch / fiddle.response.html
Created May 21, 2012 15:32
Response for testing angular's templateUrl via jsfiddle.
<div data-role="controlgroup" data-type="horizontal">
<a ng-repeat="filter in filterSet" data-role="button">{{filter.label}}</a>
</div>
@tbosch
tbosch / bookmarklet.js
Created February 4, 2012 10:04
fiddle for gist: open a popup with the content of the gist
(function () {
var d, main, lines, w, d2, i;
d = document;
function code(id) {
var el = d.querySelector('#file_' + id.replace('.', '\\.') + ' .lines .highlight');
if (el) {
return el.innerText;
}
el = d.querySelector('[name="file_contents['+id+']"]');
if (el) {
@tbosch
tbosch / controller.js
Created February 3, 2012 11:35
jquery mobile bug: styling error of controlgroup when dynamically adding new checkboxes
var nextId = 2;
function add() {
var group = $("#group");
nextId++;
$("#group").append('<label for="c' + nextId + '">C' + nextId + '</label><input id="c' + nextId + '" type="checkbox">');
$("#page").trigger("create");
}
@tbosch
tbosch / controller.js
Created February 3, 2012 09:51
todo-mobile jquery mobile angular
angular.service('todoStore', function(xhr, waitDialog) {
var readUrl = 'https://secure.openkeyval.org/';
var writeUrl = 'https://secure.openkeyval.org/store/?';
function read(key, success) {
waitDialog.show();
xhr('JSON',
readUrl + key+'?callback=JSON_CALLBACK',
function(status, data) {
success(data);