Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#------------------------------------------------------------------------------
# Configuration.
#------------------------------------------------------------------------------
#=========================================================================================
#===================================== Initial firewall configuration ==========================
#=========================================================================================
#This is the network interface for the internet
version: "3"
services:
# configuration manager for NiFi
zookeeper:
hostname: myzookeeper
container_name: zookeeper_container_persistent
image: 'bitnami/zookeeper:3.7.0' # latest image as of 2021-11-09.
restart: on-failure
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
@harshaspatil
harshaspatil / CookieManager.swift
Created January 31, 2020 20:05
WKWebview Cookie Sync Example
import Foundation
import WebKit
/// Class which syncronizes cookies for the webview.
internal final class CookieManager {
/// Cookies from http cookie store.
var httpCookies: [HTTPCookie] {
return HTTPCookieStorage.shared.cookies ?? [HTTPCookie]()
}
@FoxBuru
FoxBuru / gist:0f9fffb30ee4b0a0d63efe14b442b7a5
Created November 15, 2020 06:23
Install windows 10 using virt-install (UEFI,SPICE,QXL,Virtio)
virt-install \
--boot uefi \
--cdrom /var/lib/libvirt/images/Windows.iso \
--features vmport.state=off,hyperv.vapic.state=on,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=8191,hyperv.relaxed.state=on \
--clock offset=localtime,hypervclock_present=yes,rtc_tickpolicy=catchup,hpet_present=no,pit_tickpolicy=delay \
--machine q35 \
--vcpus 2 \
--cpu host \
--graphics spice \
--sound ich9 \
@abul4fia
abul4fia / example.py
Last active April 30, 2024 12:07
Generic formula transformation under control
"""
This is an example which uses the "low-level" interface, specifying
the indexes or slices() that should be transformed one into
another.
"""
class Test(Scene):
def construct(self):
m1 = MathTex(r"\frac{x}{y} = \frac{a}{b}\times5")
self.add(m1)
m2 = MathTex(r"x\cdot b = y\cdot a\times5")
@glasslion
glasslion / vtt2text.py
Last active April 30, 2024 12:07
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@ap1969
ap1969 / snapsvg.vue
Created July 22, 2021 09:28
Using snap-svg in Vue 3
<template>
<q-page class="flex flex-center">
<div>
<svg id="svg" width="300" height="300"></svg>
</div>
<svg width="0" height="0">
<pattern
id="pattern"
patternUnits="userSpaceOnUse"
x="0"
@tbaddade
tbaddade / a11y-list.md
Last active April 30, 2024 12:04
Sammlung für Barrierefreiheit
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
// ext_tables.sql
CREATE TABLE tx_xxxxxxx_domain_model_record (
...
type int(11) unsigned DEFAULT '0',
...
);
// TCA
'type' => [
'exclude' => false,