Skip to content

Instantly share code, notes, and snippets.

View laurengarcia's full-sized avatar

Lauren Garcia laurengarcia

  • Somewhere, everywhere.
View GitHub Profile
@opaolini
opaolini / nginx.conf
Created February 19, 2020 21:06
Mesh Example with certbot
upstream meshws {
server mesh:60559;
}
server {
listen 443 ssl;
server_name ${SERVERNAME};
ssl_certificate /etc/letsencrypt/live/${SERVERNAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${SERVERNAME}/privkey.pem;
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@mrkrndvs
mrkrndvs / export-named-sheet-as-csv.gs
Last active January 27, 2024 00:02 — forked from mderazon/export-to-csv.gs
Google apps script to export an individual sheet as csv file
/*
* script to export data of the named sheet as an individual csv files
* sheet downloaded to Google Drive and then downloaded as a CSV file
* file named according to the name of the sheet
* original author: Michael Derazon (https://gist.github.com/mderazon/9655893)
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "Download Primary Time File", functionName: "saveAsCSV"}];
@mafintosh
mafintosh / index.js
Last active July 26, 2016 23:01
dat stats demo that plays sintel.mp4
var swarm = require('hyperdrive-archive-swarm')
var hyperdrive = require('hyperdrive')
var stats = require('hypercore-stats-ui')
var http = require('http')
var memdb = require('memdb')
var serve = require('hyperdrive-http')
var drive = hyperdrive(memdb())
// a remote dat

Dat Core Technical Roadmap

A small roadmap for the core tech in dat. this mostly relates to the core dependencies such as hypercore/hyperdrive and not the cli or dat.land

Implementation

1. Finish random access APIs

Adding var cursor = drive.createByteCursor(file). A cursor api that quickly allows you to seek anywhere in the file content.

beaker ipfs/dat apps

what I think would be cool: an ipfs/dat site with an index.html that looks like this:

<!doctype html>
<script src="ipfs://mypfs.com/explorer.js@3.0.0"></script>
<script>exploreArchive('ipfs://pauls-public-files.com')</script>
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mudge
mudge / eventemitter.js
Last active April 29, 2024 07:48
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';