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
| module.exports = [ | |
| { | |
| id:1, | |
| data:1 | |
| }, | |
| { | |
| id:2, | |
| data:2 | |
| }, | |
| { |
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
| DOMAIN_NAME="domain.com" | |
| sudo certbot --authenticator standalone --installer nginx -d $DOMAIN_NAME --pre-hook "service nginx stop" --post-hook "service nginx start" |
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
| #!/bin/bash | |
| service=mysql | |
| if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
| then | |
| echo $(ps -ef | grep -v grep | grep $service ) | |
| echo "$service is running!!!" | |
| else | |
| /etc/init.d/$service start | |
| fi |
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
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| let res = { | |
| json: function(json){ | |
| return new Response(JSON.stringify(json),{'headers':{'Content-Type':'application/json'}}); | |
| } | |
| }; |
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
| {% if template contains 'collection' and collection.all_tags.size > 1 %} | |
| <!-- A recursive loop to catch and filter out the different tag categories --> | |
| {% assign c = 0 %} | |
| {% for t in collection.all_tags %} | |
| {% capture cat %}{{ cat }}{% capture temp_cat %}{% if t contains '_' %}{% assign cat_grp = t | split: '_' %}{{ cat_grp.first }}{% endif %}{% endcapture %}{% unless cat contains temp_cat %}{% if t contains '_' %}{% assign new_cat_grp = t | split: '_' %}{{ new_cat_grp.first }}{% endif %}{% unless forloop.last %}+{% endunless %}{% assign c = c | plus: 1 %}{% endunless %}{% endcapture %} | |
| {% endfor %} | |
| <!-- create array of tag categories --> | |
| {% assign cat_array = cat | split: '+' %} |
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
| /**************************************************************| CONVERT VARIANT TO SWATCHES |*/ | |
| $(function() { | |
| if($(".single-option-selector").length) { | |
| $(".single-option-selector").each(function(i) { | |
| var $thisSelect = $(this); | |
| var $newClass = "js-option-selector-" + i; | |
| var $newOptions = '<ul class="new-variant-swatchs">'; | |
| var $currentOption = $thisSelect.val(); |
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
| iptables -I INPUT -p tcp ! -s 139.59.13.17 --dport 80 -j DROP |
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
| SERVER_IP="142.93.220.116" | |
| iptables -A OUTPUT -p icmp --icmp-type 8 -s 139.59.13.17 -d 0/0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT | |
| iptables -A INPUT -p icmp --icmp-type 0 -s 0/0 -d 139.59.13.17 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| iptables -A INPUT -p icmp --icmp-type echo-request -j DROP |
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 getResponseAndWriteHeaders(sessionId) | |
| local response = red:hgetall(sessionId) | |
| for key,value in pairs(mapKeyValuePairs(response)) do | |
| ngx.req.set_header(key, value) | |
| end | |
| end | |
| function checkForExtension(sessionId) | |
| local ttl = red:ttl(sessionId) | |
| if not is Empty(ttl) and ttl < expiry() then |
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
| // Normal Static Site hosting with Digital Ocean Spaces. | |
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| const parsedUrl = new URL(request.url) | |
| let path = parsedUrl.pathname |