Skip to content

Instantly share code, notes, and snippets.

View admariner's full-sized avatar

Periklis Papanikolaou admariner

  • admariner
  • Thessaloniki
View GitHub Profile
@manchumahara
manchumahara / gist:dc88a6b9b157ada5f02cb8408653b80f
Created September 21, 2022 04:53
Google My Business Categories (Json formatted)
[
"Abbey",
"Aboriginal and Torres Strait Islander organization",
"Aboriginal art gallery",
"Abortion clinic",
"Abrasives supplier",
"Abundant Life church",
"Accountant",
"Accounting firm",
"Accounting school",
@ZordnajelA
ZordnajelA / ga4_session_scope_custom_dimension.sql
Last active February 19, 2024 06:24
Using SQL window functions to replicate Google Analytics custom dimensions behavior
LAST_VALUE(
(SELECT
value.string_value --value.int_value, value.float_value, value.double_value
FROM
UNNEST(event_params)
WHERE
key = 'name_of_event_parameter_to_use_as_dimension'
)
IGNORE nulls
) OVER (
@luratic-devs
luratic-devs / GA4 - Dimensions & Metrics Cheatsheet - Changelog.md
Last active February 2, 2025 16:20
GA4 - Dimensions & Metrics Cheatsheet - Changelog.md
@karpathy
karpathy / stablediffusionwalk.py
Last active April 23, 2025 10:26
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
import plotly.express as px
def treemap(traffic_df, metric='Users', path=['Medium', 'Source']):
"""Make in interactive treemap for two data dimensions/levels.
Parameters:
-----------
traffic_df : A DataFrame containing two dimensions, and one or more metrics
@RomainVialard
RomainVialard / Get indexes of selected rows.gs
Last active August 16, 2024 00:32
Google Apps Script - Google Sheets - Use the getActiveRangeList() method to get indexes of selected rows
function myFunction() {
const sheet = SpreadsheetApp.getActiveSheet();
const data = sheet.getDataRange().getValues();
const selectedRows = getIndexesOfSelectedRows(sheet);
for (let i = 0; i < data.length; i++) {
// skip not selected rows
if (!selectedRows.includes(i + 1)) continue;
const rowData = data[i];
console.log(rowData);
// perform the relevant action: generate a document, send an email,...
@ioannispol
ioannispol / conda-env-setup.sh
Last active September 6, 2024 01:43
Automate Anaconda environment creation
#!/usr/bin/env bash
SECONDS=0
source ~/miniconda3/etc/profile.d/conda.sh
# Set miniconda environment path
ENV_PATH="$HOME/miniconda3/envs"
echo "The folowing environments are installed:$(ls $ENV_PATH)"
@thefranke
thefranke / Redirector.json
Last active January 30, 2025 05:13
Redirector Configuration
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2023-05-24T14:38:35.748Z",
"redirects": [
{
"description": "Wikipedia -> Wikiless",
"exampleUrl": "https://en.wikipedia.org/wiki/XYZ",
"exampleResult": "https://farside.link/wikiless/wiki/XYZ",
"error": null,
"includePattern": "*wikipedia.org/*",
@pirate
pirate / pluginization_example.py
Last active October 24, 2024 04:11
Example of how to pluginize a complex app using a hooks system
"""
Example of a pluginized architecture breaking up a large app
with complex behavior (ArchiveBox), into a series of steps
that plugins can hook into.
(read from the bottom to top to get a quick overview)
"""
import re
import json
@evanreichard
evanreichard / hn-tweaks.user.js
Last active June 27, 2024 23:42
hn-tweaks.user.js
// ==UserScript==
// @name Hacker News Tweaks
// @version 0.0.3
// @downloadURL https://gist.githubusercontent.com/evanreichard/96d89512cbfe23e5d7a81479c482e6da/raw/hn-tweaks.user.js
// @match *://news.ycombinator.com/*
// @grant GM.addStyle
// @grant GM.registerMenuCommand
// @grant GM.unregisterMenuCommand
// @grant GM.getValue
// @grant GM.setValue