Navigation Menu

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
@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 May 10, 2023 10:25
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 May 13, 2023 10:00
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]
*/

Keybase proof

I hereby claim:

  • I am markomitranic on github.
  • I am markomitranic (https://keybase.io/markomitranic) on keybase.
  • I have a public key whose fingerprint is 68CF 270C 566B CB39 8DC5 6200 7355 9A15 03E7 DB25

To claim this, I am signing this object:

@markomitranic
markomitranic / client.js
Created July 16, 2018 16:08
Basic WebSocket Ping-Pong Implementation
var socket = new WebSocket('ws://localhost:8080');
socket.addEventListener('error', function(message) {
console.log('Wow guy, there was an eror.');
console.log('Heres the message:', message);
});
socket.addEventListener('open', function(message) {
console.log('Open now!!');
console.log('Heres the message:', message);