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.

@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active October 24, 2024 18:10
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 November 15, 2024 17:06
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 November 1, 2024 18:28
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 May 3, 2024 22:23
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 November 15, 2024 09:34
Basics of BrainFuck

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

BrainFuck Programming Tutorial by: Katie

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

INTRODUCTION

@CiprianSpiridon
CiprianSpiridon / Laravel-Blade-Template-Cheatsheet
Last active November 13, 2024 19:32
Laravel Blade Template Cheatsheet
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block