Skip to content

Instantly share code, notes, and snippets.

@ChrisBaker97
ChrisBaker97 / ChunkyCache.gs
Last active February 4, 2022 05:35 — forked from pilbot/ChunkyCache.gs
Using the Google Apps Script Cache Service for objects above 100Kb
function ChunkyCache(cache, chunkSize){
chunkSize = chunkSize || 100*1024;
return {
put: function (key, value, timeout) {
var json = JSON.stringify(value);
var cSize = Math.floor(chunkSize / 2);
var chunks = [];
var index = 0;
while (index < json.length){
cKey = key + "_" + index;
@nadavrot
nadavrot / Matrix.md
Last active April 2, 2024 06:45
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@dobesv
dobesv / dev_signed_cert.sh
Last active March 21, 2024 07:47
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@fanyang89
fanyang89 / fuse.ts
Created April 29, 2018 09:04
Example fuse-box config with code splitting
import * as autoprefixer from "autoprefixer";
import * as express from "express";
import {
Bundle,
CSSPlugin,
FuseBox,
FuseBoxOptions,
ImageBase64Plugin,
JSONPlugin,
PlainJSPlugin,
@jaceju
jaceju / migration.php
Created March 9, 2018 03:01
Use Laravel Migration standalone
<?php
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Events\Dispatcher;
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
See https://stackoverflow.com/questions/38335668/how-to-refer-to-typescript-enum-in-d-ts-file-when-using-amd
Run with `npm run exec`, will install all dependencies as needed.
@schlos
schlos / Google Spreadsheet GeoCode.js
Created December 10, 2017 21:20 — forked from timwburch/Google Spreadsheet GeoCode.js
Simple Google Script to GeoCode from address in cell
function getGeocodingRegion() {
return PropertiesService.getDocumentProperties().getProperty('GEOCODING_REGION') || 'au';
}
function addressToPosition() {
// Select a cell with an address and two blank spaces after it
var sheet = SpreadsheetApp.getActiveSheet();
var cells = sheet.getActiveRange();
var addressColumn = 1;
@felipeochoa
felipeochoa / pp-debug.el
Last active November 19, 2021 19:59
Pretty print emacs debug frames
;;; pp-debug.el --- Pretty-printing debugger -*- lexical-binding: t -*-
;; Copyright (C) 2018 Felipe Ochoa
;; Author: Felipe Ochoa
;; Created: 5 Dec 2017
;; License: GPLv3
;;; Commentary:
;;; Pretty-print debugger frames.
@pedronauck
pedronauck / fuse.ts
Created October 14, 2017 21:16
Fusebox config example
import {
FuseBox,
BabelPlugin,
QuantumPlugin,
WebIndexPlugin,
TypeScriptHelpers,
Sparky,
} from 'fuse-box'
import * as path from 'path'