Skip to content

Instantly share code, notes, and snippets.

View Loupeznik's full-sized avatar

Dominik Zarsky Loupeznik

View GitHub Profile
@Loupeznik
Loupeznik / mega_backup.sh
Last active February 23, 2021 21:27
Mega backup script sample for my Medium post
#!/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
#!/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 / DashboardController.php
Last active September 17, 2022 12:21
Laravel Visitor Counter - data visualization
// app/Http/Controllers/DashboardController.php
<?php
namespace App\Http\Controllers;
use App\Models\Visitor;
use Illuminate\Support\Facades\DB;
class DashboardController extends Controller
{
@Loupeznik
Loupeznik / api_usage.blade.php
Last active March 22, 2021 15:40
API usage blade file example
<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 / google-signin.html
Last active June 16, 2022 08:04
Google sign-in
<html>
<body>
<div>
<button onClick="ggl()">sign in with gugul</button>
</div>
<script>
function ggl() {
@Loupeznik
Loupeznik / bracket.html
Last active June 24, 2024 14:11
Playoffs bracket Tailwind component
<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">
@Loupeznik
Loupeznik / deployment.yaml
Created August 7, 2023 16:31
Laravel app service and deployment sample manifests (partly for Helm)
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "laravel-app.fullname" . }}
labels:
{{- include "laravel-app.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "laravel-app.selectorLabels" . | nindent 6 }}