Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominik Zarsky Loupeznik

View GitHub Profile
@Loupeznik
Loupeznik / bracket.html
Last active Jul 31, 2022
Playoffs bracket Tailwind component
View bracket.html
<div class="m-2 p-4">
<div class="mb-4 grid grid-flow-col grid-cols-3 items-center border-0 border-b-2 border-gray-200 text-center text-base md:text-lg font-bold uppercase">
<div>Quarterfinals</div>
<div>Semifinals</div>
<div>Finals</div>
</div>
<div class="grid grid-flow-col grid-cols-3 items-center">
<div class="grid grid-flow-row grid-rows-3">
<div class="mb-4 rounded-md bg-gray-200 px-4 py-2 text-gray-900 space-y-2 text-xs md:text-base">
<div class="grid grid-flow-col grid-cols-2">
View google-signin.html
<html>
<body>
<div>
<button onClick="ggl()">sign in with gugul</button>
</div>
<script>
function ggl() {
@Loupeznik
Loupeznik / api_usage.blade.php
Last active Mar 22, 2021
API usage blade file example
View api_usage.blade.php
<div class="flex flex-col mt-3">
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
<h2 class="font-semibold text-xl text-gray-800 leading-tight m-4">
My API usage
</h2>
<div class="bg-gray-200 flex items-center justify-center px-5 py-5">
<div class="w-full max-w-3xl">
<div class="-mx-2 md:flex">
@Loupeznik
Loupeznik / DashboardController.php
Last active Sep 17, 2022
Laravel Visitor Counter - data visualization
View DashboardController.php
// app/Http/Controllers/DashboardController.php
<?php
namespace App\Http\Controllers;
use App\Models\Visitor;
use Illuminate\Support\Facades\DB;
class DashboardController extends Controller
{
View api_test.py
#!/usr/bin/python3
import requests
url = "http://127.0.0.1:8000/api/test"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer xxxxx' #add your API token
@Loupeznik
Loupeznik / mega_backup.sh
Last active Feb 23, 2021
Mega backup script sample for my Medium post
View mega_backup.sh
#!/bin/bash
mega-login username password #placeholder values
folders="$(mega-ls)"
cur_month="$(date +%Y-%m)"
db_folder="/home/$USER/backup/db"
temp_folder="/home/$USER/scripts/temp"
stime=$(date +"%s")
echo "[MEGA BACKUP] Starting backup script"
if [[ $folders == *$cur_month* ]]; then