Skip to content

Instantly share code, notes, and snippets.

View markdimi's full-sized avatar
🏋️‍♂️
Linear progression

Markos Dimitsas markdimi

🏋️‍♂️
Linear progression
  • Codebasegr
  • Between Germany and Greece
View GitHub Profile
@rynomad
rynomad / chatGPT de-spinner
Last active April 28, 2023 20:55
highlight and drag this code into your bookmark bar. If that doesn't work, ask chatGPT how to make a bookmarklet
javascript:(function() {
function extractText(element) {
if (element.nodeType === Node.TEXT_NODE) {
return element.textContent.trim() + ' ';
}
if (element.nodeType !== Node.ELEMENT_NODE) {
return '';
}
let text = '';
for (const child of element.childNodes) {
@rlaphoenix
rlaphoenix / iptv.py
Last active February 26, 2024 16:27
Various Python Flask API utilities for working with HLS/DASH/DRM streams.
from functools import wraps
import os
import re
import subprocess
from pathlib import Path
from typing import Literal
from urllib.parse import quote_plus, unquote_plus, urlencode, urljoin
from uuid import uuid4
import requests
@ktosiu
ktosiu / ffmpeg_stream.md
Created August 25, 2020 09:11 — forked from docPhil99/ffmpeg_stream.md
Streaming FFmpeg and Python

This is running on Linux Mint

  1. Install ffmpeg
sudo apt-get install ffmpeg
  1. A simple test: open two terminals, in first run ffplay udp://127.0.0.1:23000 and in the second ffmpeg -i sample.mp4 -vcodec mpeg4 -f mpegts udp://127.0.0.1:23000 . This should play the video sample.mp4 although the quality is rather blocky.
@syntheticminds
syntheticminds / index.html
Created March 18, 2020 11:33
Alpine.js To-Do Example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Alpine.js To-Do Demo</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script>
<style>
[x-cloak] { display: none; }
@markdimi
markdimi / colored_dots.py
Last active May 12, 2019 14:29
Colored Icons to use in a palette
# A simple function that uses python3 and matplotlib, and creates a plain colored circle (transparent png image 500x500 px).
# Inputs are the color_list and and the name of the file.
# The color_list can include multiple colors. A single color create a circle with that color.
# Multiple colors create a circle divided equally by the sum of the colors
# my_dpi variable is needed in order to make matplotlib to print an image with a specific size (usually dpi=96).
# More on this SO post: https://stackoverflow.com/questions/13714454/specifying-and-saving-a-figure-with-exact-size-in-pixels
#
# here we are ploting a 500x500 image
# you can find your dpi by going here: https://www.infobyip.com/detectmonitordpi.php
@WJDigby
WJDigby / sendmail.py
Last active August 3, 2023 13:21
python3 send email via gmail API
from apiclient.discovery import build
from apiclient import errors
from httplib2 import Http
from oauth2client import file, client, tools
from email.mime.text import MIMEText
from base64 import urlsafe_b64encode
SENDER = <sender>
RECIPIENT = <recipient>
@harshvardhanmalpani
harshvardhanmalpani / createCat.php
Created October 27, 2017 08:02
How to create Magento 2 category programmatically
<?php
//creating categories in magento 2
//last verified Magento 2.2.0 27 Oct 2017
use \Magento\Framework\App\Bootstrap;
echo 'code by harshvardhanmalpani';
include('./app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
function createCategory($a='',$b=2,$c=true,$d='',$e='',$f='',$g='') {
global $objectManager;
@darencard
darencard / auto_git_file.md
Last active May 1, 2024 23:18
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@zmwangx
zmwangx / fb-dl.py
Last active November 28, 2023 20:29
Scrape all photos from a public Facebook page.
#!/usr/bin/env python
############################### README ###############################
# External dependencies:
# * libmagic
# * python-dateutil
# * python-magic
# * requests
#
# The shell command call at the end was tested with GNU date from GNU