Skip to content

Instantly share code, notes, and snippets.

View markomitranic's full-sized avatar
🧀
Cheese mode!

Marko Mitranic markomitranic

🧀
Cheese mode!
View GitHub Profile

You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.

IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse. IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).

Here are useful slash commands users can run to interact with you:

  • /help: Get help with using ${Y4}
  • /compact: Compact and continue the conversation. This is useful if the conversation is reach
@markomitranic
markomitranic / env.ts
Last active February 17, 2025 06:00
Unified Astro facade for accessing environment variables.
import * as client from "astro:env/client";
import type ServerEnv from "astro:env/server";
/**
* If we're in SSR, use the real server env.
* Otherwise, a proxy that throws if you try to access it.
*/
const server = import.meta.env.SSR
? await import("astro:env/server")
: (new Proxy(
@markomitranic
markomitranic / forecast_model_template.sql
Created March 16, 2023 08:32 — forked from Sassano-Weld/forecast_model_template.sql
Sales forecasting model written for GOOGLE BIGQUERY
--------**********---------
/*
AUTHOR: CHRISTIAN SASSANO/DARYL PAUL : WELD TECHNOLOGIES ApS
PUBLISHED: MAY 2022
https://weld.app
Join us in slack: https://join.slack.com/t/weldcommunity/shared_invite/zt-19b372339-1m9ftp0YW2AU8ToZpBViAA
Sales forecasting model written for GOOGLE BIGQUERY using the following inputs
CUSTOMER_ID|FIRST_ENTERED_SALES_FUNNEL_DATE|FIRST_CONVERTED_DATE|DAYS_TO_WON|ENTERED_SALES_FUNNEL|CONVERTED
@markomitranic
markomitranic / workspace.code-workspace.json
Created August 24, 2021 14:09
Remote Workspace Settings
{
"folders": [
{
"path": ".."
}
],
"settings": {
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#1f6fd0",
"activityBar.activeBorder": "#ee90bb",
// Simply paste all of this code on any instagram post.
// Or drag the file to the console and press Enter.
function init() {
loadAllComments();
}
function loadAllComments() {
// Load all comments pages...
const clickerInterval = setInterval(() => {
@markomitranic
markomitranic / dsize.sh
Last active November 3, 2024 16:51
List human readable sizes for all docker volumes
#!/bin/bash
set -e
for d in `docker ps -a | awk '{print $1}' | tail -n +2`; do
d_name=`docker inspect -f {{.Name}} $d`
echo "========================================================="
echo "$d_name ($d) volumes:"
VOLUME_IDS=$(docker inspect -f "{{.Config.Volumes}}" $d)
@markomitranic
markomitranic / cf_wp_worker.js
Last active June 29, 2024 12:17
CloudFlare edge worker for WP
// IMPORTANT: Either A Key/Value Namespace must be bound to this worker script
// using the variable name EDGE_CACHE. or the API parameters below should be
// configured. KV is recommended if possible since it can purge just the HTML
// instead of the full cache.
// API settings if KV isn't being used
const CLOUDFLARE_API = {
email: "", // From https://dash.cloudflare.com/profile
key: "", // Global API Key from https://dash.cloudflare.com/profile
zone: "" // "Zone ID" from the API section of the dashboard overview page https://dash.cloudflare.com/
@markomitranic
markomitranic / Log.php
Last active February 16, 2020 12:38 — forked from laverboy/LogUse.php
A simple, static, logging singleton class
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Psr\Log\LoggerInterface;
final class Log {
/** @var string */
private const OUTPUT_STREAM = 'php://stderr';
@markomitranic
markomitranic / giveaway.html
Last active January 4, 2020 16:03
Extremely simple Instagram Giveaway
<!-- USAGE: -->
<!-- Paste the whole UL with the comments (remember to load them all) -->
<!-- Put the id="list" on it -->
<!-- Attach to htmlPasta or similar service for sending to mobile -->
<!-- https://htmlpasta.com/ -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
@markomitranic
markomitranic / get-image-urls.js
Created December 21, 2019 13:55 — forked from tobek/get-image-urls.js
Save images from chrome inspector/dev tools network tab
/* open up chrome dev tools (Menu > More tools > Developer tools)
* go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading)
* right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR
* open up JS console and enter: var har = [paste]
* (pasting could take a while if there's a lot of requests)
* paste the following JS code into the console
* copy the output, paste into a text file
* open up a terminal in same directory as text file, then: wget -i [that file]
*/