Skip to content

Instantly share code, notes, and snippets.

version: "3.8"
services:
app:
build:
context: .
dockerfile: docker/server.dockerfile
command: "gunicorn --workers=2 --bind=0.0.0.0:8000 server:app"
volumes:
- ./server/server.py:/app/server.py
ampSetup() {
try {
let myPlayer = amp(
"vid1",
{
nativeControlsForTouch: false,
autoplay: false,
controls: true,
width: "800",
height: "600",
@cryocaustik
cryocaustik / README.md
Last active September 23, 2021 01:21
Python script to find Synth collections, generate them, and output the results to individual named files.

Synth Generate to dedicted files

Use the Python script generate.py to automatically walk a directory of collections, generate them, and export the results into relative individual files.

Execute Pythons script

[21-09-22 20:03:39] ➜  python generate.py
path to collections dir: c:/dev/collections/elig
export directory (default C:\dev\synth-data-generator\exports): 
@cryocaustik
cryocaustik / providers.py
Created September 10, 2021 00:56
Custom mimesis provider example
from mimesis.providers import BaseProvider
from random import choice, sample
import json
import requests
import os
class ProcCodeCMS(BaseProvider):
class Meta:
@cryocaustik
cryocaustik / databases.php
Created August 24, 2021 14:48
Laravel MySQL SSL Config
// add to mysql config
'sslmode' => 'require',
'options' => array(
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
PDO::MYSQL_ATTR_SSL_KEY => '/etc/ssl/mysql/client-key.cer',
PDO::MYSQL_ATTR_SSL_CERT => '/etc/ssl/mysql/client-cert.cer',
PDO::MYSQL_ATTR_SSL_CA => '/etc/ssl/mysql/server-ca.cer',
),
@cryocaustik
cryocaustik / tester.py
Last active July 8, 2021 01:57
Example of using python for RESTful data validation
import requests
import logging
from datetime import datetime
from pathlib import Path
LOG_DIR = Path("./logs")
logger = logging.getLogger("py-api-data-validation")
logging.basicConfig(
level=logging.INFO,
filename=LOG_DIR /
<template>
<div class="card">
<div class="card-body">
<div class="card-title">
<h2>
Custom Jitsi
<span class="text-muted ml-auto" v-if="hasJoinMsg">
{{ joinMsg }}
</span>
</h2>
@cryocaustik
cryocaustik / add_data_tables.js
Created October 1, 2020 01:42
force data tables onto html table in any site
// inject jquery
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// inject data tables
var dt = document.createElement('script');
dt.src = "//cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js";
document.getElementsByTagName('head')[0].appendChild(dt);
var dtcss = document.createElement('link');
@cryocaustik
cryocaustik / tableau_poc.md
Last active May 19, 2020 07:38
Description for Tableau Parameter Refresh on Workbook Open Failing proof of concept

Parameter Refresh on Workbook Open Failing

Proof of concept to show the parameter will refresh on opening in Desktop or Web-Authoring but fails when used as a regular workbook on a server.

Steps to Recreate

This workbook uses the TableauServerUser value to pass the username to MySQL and retrieve data allocated to the user. In order to recreate this issue, you will need to pass a user value registered in the Tableau (‘Aleksandr.Skobelev’, ‘John.Smith’, or ‘Jane.Doe’).

  1. Create a data connection (DC1) as a Tableau Extract
  2. Create another data connection (DC2) as live
@cryocaustik
cryocaustik / region_parameters_src.sql
Last active May 19, 2020 07:21
MySQL Sample data for Tableau Parameter Refresh on Workbook Open Failing PoC
-- create base tables with sample data
CREATE TABLE IF NOT EXISTS tableau_pub.regions (
id INT NOT NULL,
region VARCHAR(200) NOT NULL,
created_at DATETIME NOT NULL,
modified_at DATETIME NOT NULL
);
INSERT INTO tableau_pub.regions VALUES
(1, 'Africa', NOW(), NOW()),