Skip to content

Instantly share code, notes, and snippets.

@gt3
gt3 / customevent-polyfill.js
Last active March 1, 2022 11:50
custom event polyfill for IE 11 (>= 9 really)
// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
;(function() {
if (typeof window.CustomEvent === "function") return false
function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined }
var evt = document.createEvent("CustomEvent")
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)
return evt
}
@dasgoll
dasgoll / gist:455522f09cb963872f64e23bb58804b2
Created January 28, 2017 15:42
Jenkins REST API example using crumb
Each Jenkins page has a REST API hyperlink at the bottom, this is because each page has its own endpoint.
http://localhost:8080/me
configure
Click 'Show API Token'
78e21f82a9e137614fef5b9593bcf827 = API Token
curl -s -u goll:78e21f82a9e137614fef5b9593bcf827 http://localhost:8080/crumbIssuer/api/json
@augbog
augbog / Free O'Reilly Books.md
Last active March 2, 2024 22:24
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {