Skip to content

Instantly share code, notes, and snippets.

View ptomasroos's full-sized avatar

Tomas Roos ptomasroos

View GitHub Profile
@webdados
webdados / ga_tcf2.js
Last active February 23, 2024 08:45
Google Analytics with TCF v2.0 support
/* Need help? Hire us: https://www.webdados.pt/contactos/ */
//We need to wait for the page to be ready, or else the Consent platform may not be loaded yet, and we'll fire the pageview earlier than we should
window.onload = function() {
var google_analytics_id = 'UA-111111-01'; //Replace with yours
//Prepare the data layer
window.dataLayer = window.dataLayer || []
//gtag function
function gtag() {
dataLayer.push(arguments);
@patmigliaccio
patmigliaccio / install-cf-gae-ssl.md
Last active November 4, 2024 13:51
Configuring Cloudflare SSL/TLS certificates on Google App Engine

Configuring Cloudflare SSL/TLS on Google App Engine

Implementing end-to-end HTTPS encryption with CloudFlare for Google App Engine applications.

Google App Engine - Custom Domains

Add Domains

Register the root domain with Google Cloud Platform at the following:

@cmod
cmod / hugofastsearch.md
Last active November 18, 2024 19:56 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

@Centril
Centril / await.md
Last active April 30, 2019 13:52
Centril's views on the "Await Syntax Write Up"

Centril's views on the "Await Syntax Write Up"

in our opinion this — which we will call the "error handling problem” — remains the primary problem that we are trying to resolve.

I don't agree that this is the primary problem; it's one of many problems to resolve; Chaining (and thus not forcing temporaries), general composability, and working well with IDEs is among notable problems.

Syntactic Sugar Solution:

I think it is a stretch to call this syntactic sugar in the first place. The syntax await? is composing await + ?. In my view this is not enough semantic compression to be deserving of the description "syntactic sugar".

@kstrauser
kstrauser / black.md
Last active March 18, 2023 00:24
Using the "black" Python formatter in VS Code

This is how to use the Black Python code formatter in VS Code.

Make a Python 3.6 virtualenv for running Black

Black itself requires Python 3.6 to run, but few of our projects are on that version. The VS Code plugin conveniently lets you run black from its own virtualenv.

I had to give a specific version of black this morning. I didn't yesterday. Don't specify the version unless it makes you (and if you do, give the current version, not the one from this doc).

$ cd ~/Envs
@eddiewebb
eddiewebb / readme.md
Last active October 24, 2024 06:51
Hugo JS Searching with Fuse.js
@shihanng
shihanng / .chunkwmrc
Last active January 6, 2024 04:17
chunkwm + skhd
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
@lostmsu
lostmsu / LifeSpan.cs
Last active April 10, 2024 06:54
Control LifeSpan treadmill from C# (treadmill drops connection if not kept alive)
// License: MIT
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
public class LifeSpanTreadmill: IDisposable
{
@linar-jether
linar-jether / simple_python_datasource.py
Last active September 10, 2024 19:46
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource ---- Up-to-date version maintained @ https://github.com/panodata/grafana-pandas-datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'