Skip to content

Instantly share code, notes, and snippets.

@claudiodekker
claudiodekker / github-sponsors-graphql.graphql
Last active May 14, 2023 22:15
Retrieve a list of sponsors from the Github Graph API
query ($owner: String!, $after: String) {
user (login: $owner) {
sponsorshipsAsMaintainer(first: 100, after: $after, includePrivate: true) {
totalCount
nodes {
sponsorEntity {
... on User {
login
}
}
@kaznum
kaznum / gist:3810258
Created October 1, 2012 08:16
sanitize HTML with jQuery
/*
* sanitize HTML with jQuery based on whitelist
* example:
* sanitizer.sanitize('<a href="foo" class="bar">aaa</a><script>alert("...")</script>', {'a': ['href'], 'strong': []})
* returns '<a href="foo">aaa</a>'
*/
var sanitizer = {};
(function($) {
function trimAttributes(node, allowedAttrs) {
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})