Skip to content

Instantly share code, notes, and snippets.

@Mr0grog
Mr0grog / summarize.py
Last active January 26, 2023 18:45
Summarize log files from EDGI Wayback imports
from datetime import timedelta
import dateutil.parser
from pathlib import Path
import re
START_LINE = re.compile(r'^\[([^\]]+)\] Starting Internet Archive Import')
END_LINE = re.compile(r'^\s*Internet Archive import completed at (.+)')
SUMMARY_START = re.compile(r'^\s*Loaded (\d+) CDX records:')
SUMMARY_ITEM = re.compile(r'^\s*(\d+)\s([\s\w\-]+)\s\(')
IMPORT_ERRORS = re.compile(r'^\s*Total:\s*(\d+)\serrors')
@magickatt
magickatt / github_clone_using_token.sh
Created September 6, 2019 17:31
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@maptiler
maptiler / globalmaptiles.py
Created August 13, 2018 10:37
globalmaptiles.py
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
@dreyescat
dreyescat / index.html
Created December 18, 2015 18:02
Webpack config to expose bundle in a variable in the global context
<html>
<head>
</head>
<body>
<script src="lib/yourlib.js"></script>
<script>
window.onload = function () {
EntryPoint.run();
};
</script>
@jpalala
jpalala / how-to-setup-mac-elasticsearch.md
Created September 11, 2015 08:28
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

@hedgerh
hedgerh / README.md
Last active October 24, 2023 13:23
Sublime Text Snippet for a React component using ES6 class syntax.

ES6 Class style React Component Quick Generator Snippet

  1. Go to Tools > New Snippetin Sublime Text
  2. Paste the code from es6-create-class-component.sublime-snippet
  3. Feel free to change tabTriggerto a custom trigger, if you don't like rcc
  4. Save it anywhere in Packages/User.
  5. Inside of an empty js/jsx file, type the trigger (rcc by default), then press TAB or RETURN, and..

ES6 Class Style React Component Boilerplate

@PurpleBooth
PurpleBooth / README-Template.md
Last active July 6, 2024 04:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@squarism
squarism / elk_stack_install.md
Last active October 22, 2023 12:25
Quick Elasticsearch / Kibana / Logstash (ELK stack) Install (for your local mac dev box)

Elasticsearch / Kibana / Logstash Quick Install

Instructions for getting an ELK stack set up quick on Mac. Paths are opinionated. You'll have to infer and change. Sorry mate. 🍰

Install Homebrew if not already. You probably have. If not, you should.

brew install elasticsearch nginx

do yourself a favor and get a better services command than launchctl

@joepie91
joepie91 / promise-router.js
Created December 25, 2014 22:31
Using Express.js with Promises
/* Without using express-promise-router...
* If either of the two Promise-returning methods ends up failing (ie. rejecting),
* an uncaught exception will be printed to stdout, and the client will never get
* a response - instead, they'll be stuck on an infinitely loading page.
*/
express = require("express").router();
router.get("/", function(req, res) {
Promise.try(function(){