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 lazyLoad(element, type, rel, link, crossOrigin = "anonymous", integrity = false) { | |
var x = document.createElement(element); | |
x.type = type; | |
x.rel = rel; | |
x.href = link; | |
// subresource integrity for external content from different domains | |
if (integrity) { | |
x.crossOrigin = crossOrigin; | |
x.integrity = integrity; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
text{ | |
font-family:Helvetica, Arial, sans-serif; | |
font-size:11px; | |
pointer-events:none; |
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
@echo off | |
:: Basic welcome message | |
echo Dieses Skript wird die grundlegenden Bestandteile installieren. | |
echo Nach der Installation sollte sich das Programm ohne Probleme nutzen lassen. | |
echo. | |
:: Are you sure prompt | |
setlocal | |
:PROMPT |
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
/* Copyright 2017 Google Inc. */ | |
/** | |
* Swaps the display settings of two elements. Before calling, exactly one | |
* of the two elements should have style="display:none" and it shows the one | |
* that is hidden and hides the one that is shown. | |
*/ | |
function _showHide(id1, id2) { | |
var x1 = document.getElementById(id1); |
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 re | |
import pandas as pd | |
DATE_TIME = re.compile(r"([(\[]).*?([)\]])") | |
AUTHOR = re.compile(r"((( [a-zA-ZöäüÖÄÜ]+)+):)") | |
LTR = chr(8206) | |
def to_pd_row(s): | |
match = DATE_TIME.match(s) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
long factorial(long n) { | |
if (n == 0) | |
return 1; | |
else | |
return (n * factorial(n - 1)); | |
} |
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
class OrderableMixin(object): | |
""" Mixin to make database models comparable """ | |
order_index = db.Column(db.Integer, default=_default_index, index=True) | |
@classmethod | |
def normalize(cls): | |
""" Normalize all order indexes """ | |
for idx, item in enumerate(cls.query.order_by(cls.order_index).all()): | |
item.order_index = idx | |
db.session.commit() |
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
<form action="" method="POST" role="form" class="form"> | |
{{ form.hidden_tag() }} | |
<!--Other fields--> | |
{{ wtf.form_field(form.tags, placeholder='audio, hardware, chip') }} | |
<button class="btn btn-success" type="submit">submit</button> | |
</form> |
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 requests # install if necessary -> pip install requests | |
URL = 'https://api.noopschallenge.com' + '/hexbot' # change the last part to query different machines | |
r = requests.get(URL) | |
result = r.json() | |
print(result['colors'][0]['value']) # prints the hex code, e.g. #7A5A28 | |
# Additional parameters |
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
{% macro confirm_deletion(endpoint='#') %} | |
<div id="confirm-deletion"> | |
<button type="button" class="btn btn-danger" data-toggle="modal" | |
data-target="#MyFancyModal">Löschen | |
</button> | |
<div id="MyFancyModal" class="modal fade" role="dialog"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> |