Skip to content

Instantly share code, notes, and snippets.

@sttt
sttt / main.py
Last active March 23, 2022 12:37
An example of transferring data for calculation to FastAPI, and returning the result.
"""
pip3 install uvicorn pydantic fastapi
[the path to the current fastapi project]>uvicorn main:app --host=127.0.0.1 --port=8888 --reload --workers 4
get swagger:
http://127.0.0.1:8888/docs
http://127.0.0.1:8888/redoc
get API:
http://127.0.0.1:8888/
@sttt
sttt / analytics-widget-tailwind-css-chart-js.markdown
Created February 2, 2022 12:25
Analytics Widget - Tailwind CSS + Chart.js

Analytics Widget - Tailwind CSS + Chart.js

A beautiful analytics widget made of a line chart, built with Tailwind and Chart.js 3.

A Pen by Cruip on CodePen.

License.

@sttt
sttt / index.html
Created February 2, 2022 12:24
Post excerpt - Tailwind CSS
<!--
Include Tailwind JIT CDN compiler
More info: https://beyondco.de/blog/tailwind-jit-compiler-via-cdn
-->
<script src="https://unpkg.com/tailwindcss-jit-cdn"></script>
<!-- Specify a custom Tailwind configuration -->
<script type="tailwind-config">
{
theme: {
@sttt
sttt / index.html
Created February 2, 2022 12:24
Post excerpt - Tailwind CSS
<!--
Include Tailwind JIT CDN compiler
More info: https://beyondco.de/blog/tailwind-jit-compiler-via-cdn
-->
<script src="https://unpkg.com/tailwindcss-jit-cdn"></script>
<!-- Specify a custom Tailwind configuration -->
<script type="tailwind-config">
{
theme: {
@sttt
sttt / pws_keys.py
Created November 1, 2021 09:45 — forked from lmeulen/pws_keys.py
pws_keys
from OpenSSL import crypto, SSL
def generate_certificate(
organization="PrivacyFilter",
common_name="https://www.url.com",
country="NL",
duration=(365 * 24 * 60 * 60),
keyfilename="key.pem",
certfilename="cert.pem"):

Try RyuJIT -- Your code runs faster on X64 Windows

How to enable RyuJIT

Download and install RyuJIT now.

RyuJIT only works on 64-bit editions of Windows 8.1 or Windows Server 2012 R2. It will support a larger set of Windows OSes at release

After installation, there are two ways to turn on RyuJIT. If you just want to enable RyuJIT for one application, set an environment variable:

@sttt
sttt / index.html
Created April 17, 2018 20:41
Smooth spots background animation
<svg id="svg1" style="width:510px; height:200px;" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g x="0" y="0" width="100%" height="100%">
<rect x="0" y="0" width="100%" height="100%" fill="green" />
<g id="svgBack">
</g>
</g>
</svg>
<button onclick="generateBack('svgBack');">Fill it</button>
@sttt
sttt / index.html
Created March 24, 2018 10:57
Meatballs
<main class="overflow-hidden vh-100 flex items-stretch overflow-hidden">
<svg class="w-100 h-100" viewBox="0 0 1200 1200" preserveAspectRatio="xMidYMid slice">
<defs>
<pattern id="meatball" patternUnits="userSpaceOnUse" width="400" height="400">
<image xlink:href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/149125/meatball.jpg" x="0" y="0" width="766" height="748" />
</pattern>
</defs>
<g stroke-width="6" fill="url(#meatball)">
<circle id="js-circle1" cx="400" cy="600" r="96" />
@sttt
sttt / index.html
Created February 21, 2018 01:22
Modal Box Sederhana
<!-- Pasang di bawah <body> -->
<div id='arlinaoverlay'/>
<div id='arlinafitri'>
<p>Saya, selaku admin Arlina Design mengucapkan<br/>
"Selamat Hari Raya Idul Fitri 1 Syawal 1436 H, Minal Aidin Wal Faidzin Taqabalallahu minnaa wa minkum"</p>
<div class='arlinaclick' onclick='document.getElementById("arlinafitri").style.display="none";arlinaoverlay.style.display="none";'>Close</div>
</div>
<!-- Source : http://www.kompiajaib.com/2014/06/membuat-pesan-pembuka-ketika-masuk-blog.html -->