Skip to content

Instantly share code, notes, and snippets.

💭
Tired

Jake Archibald jakearchibald

💭
Tired
View GitHub Profile
View gist:8a9c47094b6e31de5cb2
function assertOkResponse(response) {
if (response.type === 'opaque' || response.status === 200) {
return response;
}
throw Error("Bad response: " + response.status);
}
fetch(url, {'mode': 'cors'}).then(assertOkResponse).then(function(response) {
// cache
}).catch(function(err) {
View dabblet.css
.test, .test2 {
width: 200px;
height: 200px;
background: green;
border-radius: 500px;
position: relative;
transition: all 2s linear;
left: 0;
margin: 0 0 10px;
}
View gist:270332
function getItemIndex(elm) {
var siblings = elm.slice(0,1).parent().children(),
i = siblings.length;
while(i--) {
if (siblings[i] == elm[0]) {
return i;
}
}
return -1;
View gist:176922
glow.ready(function() {
var myPanel = new glow.widgets.Panel("#formPanel");
//display panel
myPanel.show();
})
View Glow trim form fields
// create our form
var myForm = new glow.forms.Form("#fmcustomer")
var myForm = glow.lang.trim("txtCompany","txtForename","txtSurname2)
// add tests for First Name
.addTests(
"txtCompany",
["required", {
on: "change submit",
message: "Please tell us your company name"
}]
You can’t perform that action at this time.