Skip to content

Instantly share code, notes, and snippets.

View nerdalertdk's full-sized avatar

nerdalertdk nerdalertdk

View GitHub Profile
@Xaero252
Xaero252 / Moved.md
Last active May 26, 2019 02:17
Enable nvdec support for plex dockers on unraid
#!/bin/bash
# Necessario configurar no /etc/crontab a seguinte linha:
#
# */30 * * * * zabbix /etc/zabbix/scripts/dnsbl.sh
#
##########################################################
# Debug
#set -x
@bcnzer
bcnzer / cloudflareworker-verifyjwt.js
Last active July 2, 2024 10:18
Sample Cloudflare worker that gets the JWT, ensures it hasn't expired, decrypts it and returns a result
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/
/**
* Fetch and log a request
* @param {Request} request
*/
@kizzx2
kizzx2 / docker-compose.yml
Last active April 19, 2025 18:01
Restart a docker container periodically with docker-compose
version: '3'
services:
app:
image: nginx:alpine
ports: ["80:80"]
restart: unless-stopped
restarter:
image: docker:cli
volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
@biox
biox / postinstall.sh
Last active December 9, 2018 14:29 — forked from pgaskin/jessie-base.preseed
A preseed file for a minimal Debian Jessie installation
#!/bin/sh
# Put commands to run in target after install here
@jacurtis
jacurtis / toast-notifications.blade.php
Last active July 7, 2021 21:35
Self Contained Vue.js Instance to Manage LaraFlash Notifications in Laravel
{{--
This makes a great "partial" to add to your template layout file. It will self manage your
notifications so you do not need to worry about displaying them. Simply just add notifications
using LaraFlash (Laravel Package) in your controllers, and they will display intelligently
and elegantly into your views.
Simply use an @include statement in your main template/layout file to this partial so that
this partial is included with every view. The rest can be set once and forgotten.
Requirements:
@giordanocardillo
giordanocardillo / Dockerfile
Last active October 14, 2018 23:27
Docker php 7 with ssh2, zip and odbc
FROM php:7.1.11-apache-jessie
RUN set -e; \
BUILD_PACKAGES="libzip-dev libssh2-1-dev unixodbc-dev"; \
a2enmod headers proxy proxy_http ssl rewrite; \
apt-get update; \
apt-get install -y $BUILD_PACKAGES; \
set +e; \
docker-php-ext-install odbc; \
set -e; \
cd /usr/src/php/ext/odbc; \
@bwhaley
bwhaley / cassandra-rolling-restart.yml
Created October 30, 2017 22:33
Ansible playbook for graceful rolling restart of the nodes in a cassandra cluster
- hosts: "*"
become: True
serial: 1
tasks:
- name: Initiate graceful shutdown
shell: "nodetool {{item}} && sleep 5"
with_items:
- disablethrift
- disablebinary
- disablegossip
<?php
if (!function_exists('timezoneArray')) {
/**
* description
*
* @param
* @return
*/
@adamwathan
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
Promise.takeAtLeast
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {