This file contains 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
{% set items = [] %} | |
{% for child in page.collection() %} | |
{% set items = items|merge([{ frontmatter: child.header, content: child.content} ]) %} | |
{% endfor %} | |
{% set payload = { | |
name: page.header.title, | |
route: page.route, | |
type: page.template, | |
items: items, |
This file contains 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
#!/bin/bash | |
# Check if command was ran as root. | |
if [[ $(id -u) -eq 0 ]]; then | |
echo "The command \"sphp\" should not be executed as root or via sudo directly." | |
echo "When a service requires root access, you will be prompted for a password as needed." | |
exit 1 | |
fi | |
# Usage |
This file contains 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
// current | |
((window.gitter = {}).chat = {}).options = { | |
room: 'getgrav/grav' | |
}; | |
document.addEventListener('gitter-sidecar-instance-started', function(e) { | |
$('.gitter-open-chat-button').html('<i class="fa fa-comments-o fa-fw"></i> Open Chat'); | |
}); | |
}); | |
// ideal |
This file contains 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
<?php | |
$file = file_get_contents('file.json'); | |
$count = -1; | |
preg_match_all("/(?:color:\s'([^']+)')/i", $file, $colors); | |
preg_match_all("/(?:windows:\s'([^']+)')/i", $file, $windows); | |
$file = preg_replace_callback("/(?:url:\s'([^']+)')/i", function($matches) use (&$count, $colors, $windows) { | |
$count++; | |
return "url: '". $matches[1] . $colors[1][$count] . '-' . $windows[1][$count] . ".jpg'"; | |
}, $file); |
This file contains 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
#define MIC A1 | |
#define LED 3 | |
void setup(){ | |
//for debug | |
//Serial.begin(9600); | |
pinMode(MIC, INPUT); | |
pinMode(LED, OUTPUT); | |
} |