Skip to content

Instantly share code, notes, and snippets.

View Antoinebr's full-sized avatar
:octocat:
🔥

Antoinebr

:octocat:
🔥
View GitHub Profile
@johnsfuller
johnsfuller / hubspot-hubl.html
Created July 20, 2021 12:32
WordPress/PHP & HubSpot/HubL Comparison Cheat Sheet
<!-- 👇 Scroll down 👇 -->
{# variables #}
{% set my_variable = 'Hello world' %}
{# get variables from somewhere else #}
{% import 'path/to/hubl-variables.html' as site_vars %}
{{ site_vars.my_external_variable }}
@iDVB
iDVB / docker-compose.yml
Last active October 24, 2018 00:51
WebPageTest local
version: "2"
services:
server:
image: webpagetest/server:latest
volumes:
- ./server/locations.ini:/var/www/html/settings/locations.ini
agent:
image: webpagetest/agent:latest
environment:
@anthonytxie
anthonytxie / hodl20.py
Created March 24, 2018 21:01
Hodl 20 Rebalancing Algorithm
def calc_allocations(self, date, quantity, cap):
"""Figure out ideal allocations for a given date"""
# {
# coin_name: (percent_allocation, data)
# }
top_market = self.get_top_market(date, quantity)
total_cap = sum([coin.market_cap for coin in top_market])
allocations = [{
@marteinn
marteinn / list.md
Last active April 20, 2021 22:00
Which sites are using Turbolinks?
@brunoleles
brunoleles / deb: command not found.md
Last active February 23, 2022 14:27
Add repository on Debian when "deb" command is not available

deb: command not found

This gist seems to be not working anymore

Possible alternative solution https://unix.stackexchange.com/a/508728 ( not tested )

The Problem

$&gt; deb http://ftp.debian.org/debian jessie-backports main
@LosantGists
LosantGists / esp8266-deep-sleep.ino
Created March 15, 2017 15:21
An example showing how to put a ESP8266 device into Deep-sleep mode
/**
* An example showing how to put ESP8266 into Deep-sleep mode
*/
void setup() {
Serial.begin(115200);
Serial.setTimeout(2000);
// Wait for serial to initialize.
while(!Serial) { }
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@pibby
pibby / critcss.snippet.js
Last active August 23, 2020 16:22 — forked from james-Ballyhoo/critcss.snippet.js
Critical CSS Finder w/media query support for those of us who write mobile-first CSS; will output to console; configurable viewport height on line 12.
/* Critical CSS Finder w/media query support and output to console
by Katie Harron - https://github.com/pibby - https://pibby.com
forked from james-Ballyhoo (https://gist.github.com/james-Ballyhoo/04761ed2a5778c505527) who forked from PaulKinlan (https://gist.github.com/PaulKinlan/6284142)
I don't know why this isn't keeping my 2 space indents :(
*/
(function() {
function findCriticalCSS(w, d) {
// Pseudo classes formatting
var formatPseudo = /([^\s,\:\(])\:\:?(?!not)[a-zA-Z\-]{1,}(?:\(.*?\))?/g;
@sorenlouv
sorenlouv / cpu-intensive.js
Last active December 19, 2023 06:00
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
function mySlowFunction(baseNumber) {
console.time('mySlowFunction');
let result = 0;
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) {
result += Math.atan(i) * Math.tan(i);
};
console.timeEnd('mySlowFunction');
}
mySlowFunction(8); // higher number => more iterations => slower
@stefanmaric
stefanmaric / open-sans.css
Created June 16, 2015 17:48
All (13) Open Sans variants. CSS embedded. WOFF format. Base64 encoded. Basic Western subsetting. font-face declaration using style links.
/* Open Sans - by Steve Matteson, Apache License version 2.0 */
/* Open Sans Light */
@font-face {
font-family: 'Open Sans';
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAF5IABMAAAAArgwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAca7DAFEdERUYAAAHEAAAAHQAAAB4AJwDwR1BPUwAAAeQAAASiAAAJmCwaFlhHU1VCAAAGiAAAAIEAAACooF6Ikk9TLzIAAAcMAAAAXgAAAGCgeJYXY21hcAAAB2wAAAGGAAAB2s9AWKBjdnQgAAAI9AAAADgAAAA4ClINZmZwZ20AAAksAAABsQAAAmVTtC+nZ2FzcAAACuAAAAAIAAAACAAAABBnbHlmAAAK6AAASiYAAI54OERAeGhlYWQAAFUQAAAAMwAAADYJcp/SaGhlYQAAVUQAAAAfAAAAJA9bBixobXR4AABVZAAAAjEAAAOmuKtcmWxvY2EAAFeYAAABzgAAAdZKMihUbWF4cAAAWWgAAAAgAAAAIAIHAc1uYW1lAABZiAAAAhoAAATiYqqsfHBvc3QAAFukAAAB6wAAAt17wozucHJlcAAAXZAAAACvAAABLyQjUqh3ZWJmAABeQAAAAAYAAAAG7WNVfgAAAAEAAAAA0MoNVwAAAADJQhTbAAAAANGkneF42mNgZGBg4AFiMSBmYmAEwpdAzALmMQAADaEBGAAAAHjarZZLbFRVGMf/M51hxoKWqtH4CBoyNrUGjQ1J27GwatpaDZZpi4MOig/iAkJCY0hMExaFgbgwIQYrOTxqCkyh0FmQUpryMkxXLNzhaW3jyuVJV8QFIY6/c9sp4EjVxHz55dw597vf43/OPXMVklSpbn2qSEvru916/rOvenep5oveHTtVv+uTL3dro