-
show.bs.modal: fired just before the modal is open. -
shown.bs.modal: fired after the modal is shown. -
hide.bs.modal: fired just before the modal is hidden. -
hidden.bs.modal: fired after the modal is closed. -
loaded.bs.modal: fired when remote content is successfully loaded in the modal’s content area using the remote option mentioned above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source: https://github.com/freebroccolo/docker-haskell/blob/master/examples/7.10/snap/Dockerfile | |
| FROM haskell:8 | |
| WORKDIR /opt/app | |
| RUN cabal update | |
| # Cache dependency installation | |
| COPY ./haskelldockertest.cabal /opt/app/haskelldockertest.cabal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.Callable; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.FutureTask; | |
| public class Main { | |
| public static void main(String[] args) throws InterruptedException, ExecutionException { | |
| class Query1Callable implements Callable<String> { | |
| private final String arg1; | |
| private Query1Callable(String arg1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| import numpy as np | |
| from random import randint | |
| def init_weights(shape): | |
| # Initializes a Tensor of size (x,y) with random weights | |
| weights = tf.random_normal(shape, stddev=1) | |
| return tf.Variable(weights) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \begin{tikzpicture} | |
| \pgfplotsset{ | |
| scale only axis, | |
| } | |
| \begin{axis}[ | |
| %axis x line*=bottom, | |
| %axis y line*=left, | |
| xlabel=$A$, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function showBrowserNotification(text) { | |
| // check if the browser supports notifications | |
| if (!("Notification" in window)) { | |
| // no support | |
| } | |
| // check whether notification permissions have already been granted | |
| else if (Notification.permission === "granted") { | |
| var notification = new Notification(text); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array.sort(function(a,b){ | |
| // Turn your strings into dates, and then subtract them | |
| // to get a value that is either negative, positive, or zero. | |
| return new Date(b.date) - new Date(a.date); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // events - a super-basic Javascript (publish subscribe) pattern | |
| const events = { | |
| events: {}, | |
| on: function (eventName, fn) { | |
| this.events[eventName] = this.events[eventName] || []; | |
| this.events[eventName].push(fn); | |
| }, | |
| off: function(eventName, fn) { | |
| if (this.events[eventName]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // smooth scrolling of links like <a href="#bla"> | |
| var $viewport = $('html, body'); | |
| $('a[href*="#"]:not([href="#"])').on('click', function(e) { | |
| if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { | |
| var target = $(this.hash); | |
| target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
| if (target.length) { | |
| $viewport.animate({ | |
| scrollTop: target.offset().top // scroll to target | |
| }, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Show error code | |
| // Shows the given error code in binary format at the passed pin | |
| // A short blink represents a binary "0", long blink a binary "1". | |
| // MSB first | |
| // | |
| // @param uint8_t code: The error code to "blink", [0;255] | |
| // @param uint8_t pin: The output pin to use, default: 13 | |
| // | |
| // @return void | |
| void showErrorCode(uint8_t code, uint8_t pin = 13) { |