Skip to content

Instantly share code, notes, and snippets.

View Leodau's full-sized avatar
🥓
Where is my bacon sandwich?

Michele Leo Leodau

🥓
Where is my bacon sandwich?
View GitHub Profile
@arnars
arnars / Gatsby v2 using Internet Explorer.md
Last active February 15, 2021 08:01
Tips for making Gatsby v2 working with IE / Internet Explorer

Making Gatsby work with Internet Explorer 10 and 11

I created this gist in order to help myself and others keep track of tips and tricks in order to make Gatsby v2 play nicely with Internet Explorer 10 and 11.

This is experience based. Please share your experiences when you have a solution to a problem.

External compilation of modules

If you suspect that an es6-based module is breaking your app, then try to add gatsby-plugin-compile-es6-packages and include the package as one of the modules.

@Leodau
Leodau / settings.json
Last active March 24, 2025 10:54
VSCODE LEO Settings
{
// Fonts
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14,
"editor.fontLigatures": true,
// Editor & Usage
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.cursorSmoothCaretAnimation": "on",
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 17, 2025 06:52
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@bradtraversy
bradtraversy / docker-help.md
Last active April 14, 2025 16:45
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@kaityo256
kaityo256 / test.cpp
Created November 7, 2017 08:34
malloc test on multithread
#include <cstdio>
#include <cstdlib>
#include <omp.h>
const int N = 16;
int
main(int argc, char **argv){
char *buf[N];
size_t size = atoi(argv[1]);
printf("digraph test_%d\n {\n",size);
#pragma omp parallel for
@ChrisCates
ChrisCates / ringbuffer.js
Created August 20, 2017 19:58
Ring Buffer in Node.js
class RingBuffer {
constructor(size) {
this.size = size;
this.pointer = 0;
this.buffer = [];
}
get(key) {
return this.buffer[key];
}
@simonhamp
simonhamp / AppServiceProvider.php
Last active April 7, 2025 20:15
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@StagPoint
StagPoint / QuaternionCompression.cs
Last active December 2, 2024 07:38
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using
@emiloberg
emiloberg / Gulpfile.js
Last active February 28, 2021 14:34
Restart node.js and reload Chrome tab(s) when files change
/**
* This Gulpfile will monitor files and restart node.js
* and reload the Chrome browser tab(s) when files changes.
*
* Dependencies:
* gulp npm install -g gulp (obviously as this is a gulp script)
* gulp-nodemon npm install gulp-nodemon
* chrome-cli brew install chrome-cli (https://github.com/prasmussen/chrome-cli)
*
* Installation
@roachhd
roachhd / README.md
Last active April 19, 2025 07:38
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION