Skip to content

Instantly share code, notes, and snippets.

View admariner's full-sized avatar

Periklis Papanikolaou admariner

  • admariner
  • Thessaloniki
View GitHub Profile
@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
@boydnorwood
boydnorwood / gist:e19086c77c477b8ad32f00d0c1247add
Last active March 21, 2024 08:28
SQL for generating a basic rankings report in Data Studio with data from your Nozzle workspace
--Top Ranking URLs Report for Nozzle.io
--Data Studio Template can be found here: https://datastudio.google.com/u/1/reporting/359d4414-0cd6-4da1-8df5-2c6908e0ddec/page/pyxcB
WITH
-- find the latest versioned keyword data
-- this can also be used to pin a query to an older version, good for static reports
latest_keyword_source_versions AS (
SELECT keyword_source_id, MAX(keyword_source_version_id) AS keyword_source_version_id
FROM nozzledata.nozzle_nozzleofficial.keywords
WHERE keyword_source_id=930701976723823
@rvanbruggen
rvanbruggen / Pandora_Papers_neo4jguide.mdx
Last active November 10, 2021 21:55
Pandora Papers - the Power Players

The Pandora Papers Guide

Graphic courtesy of ICIJ

Background

The Pandora Papers have rocked the world. News organisations began publishing their explosive contents on October 3, the giant leak has dominated headlines and posed questions of some of the world’s most powerful people and their financial propriety.

Some highlights:

@dwsmart
dwsmart / logflare_to_common_log_format.js
Last active November 14, 2023 10:26
Logflare to Common Log Format nodejs Script
// require libs
// run npm install @google-cloud/bigquery
const { BigQuery } = require('@google-cloud/bigquery');
const fs = require('fs');
// BigQuery Config - see https://cloud.google.com/docs/authentication/production#create_service_account
const options = {
keyFilename: '{path_to_key_file}',
projectId: '{project_id}',
};
# -*- coding: utf-8 -*-
"""
@author: satyam.kumar
"""
'''
Import necessary packages
'''
@hannesdatta
hannesdatta / install_packages.R
Created June 25, 2021 07:48
automatically install all R packages used in a project (scans all source code files)
################################
# FIND AND INSTALL R PACKAGES #
# #
# #
# Searches source code for #
# references to packages, #
# and installs all #
# uninstalled packages. #
# #
# Put this script in the #
@mikeciffone
mikeciffone / gsc-regex-index
Created April 16, 2021 13:15
Useful Google Search Console Regex (Re2)
#################################################################################
# Running List as of 04/16/2021
# Uses Re2 so PCRE-style backreferences and look-around assertions are not supported
# -------------------------------------------------------------------------------
# Refrence:
# https://github.com/google/re2/blob/master/doc/syntax.txt
# https://search.google.com/search-console
##################################################################################
# Matches URL slug
@alenegro81
alenegro81 / evaluate_embedding.py
Created March 20, 2021 10:23
A piece of code for evaluating the embedding
def evaluate(self):
with self._driver.session(database=self.get_database()) as session:
query = """
MATCH (node:DrkgNode)
WITH node, rand() as rand
order by rand
LIMIT 10000
RETURN coalesce(node.symbol, node.id) as nodeId, node.embeddingVectorFastRP as embedding, labels(node)[1] as category
"""
result = session.run(query)
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,