Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
cat <<EOF | xargs -L1 ipfs ping -n 1
QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA
QmbVWZQhCGrS7DhgLqWbgvdmKN7JueKCREVanfnVpgyq8x
QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE
QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR
QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i
EOF
@anacrolix
anacrolix / ipgo.sh
Last active February 28, 2019 18:49 — forked from Stebalien/ipgo.sh
#!/bin/bash
set -eu
export IPFS_GATEWAY="${IPFS_GATEWAY:-http://127.0.0.1:8080}"
CACHE_DIR="$(go env GOPATH)/pkg/mod/cache"
basepath() {
echo "${1##${CACHE_DIR}/download/}"
@ericnograles
ericnograles / graphql_types_assembler.js
Created January 18, 2018 15:01
Dynamic construction of .graphql files as one schema text file to load to makeExecutableSchema
const path = require('path');
const fs = require('fs');
const topLevelQuery = fs.readFileSync(
path.resolve(__dirname, 'Query.graphql'),
{ encoding: 'UTF-8' }
);
let types = fs
.readdirSync(__dirname)
.filter(fileName => {
@BretFisher
BretFisher / docker-for-mac.md
Last active April 26, 2024 09:38
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@dtomasi
dtomasi / default
Last active December 8, 2023 04:20
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@rampage644
rampage644 / airflow_deploy_design.md
Created October 6, 2015 20:53
Airflow flows deployment

Introduction

This document describes how Airflow jobs (or workflows) get deployed onto production system.

Directory structure

  • HOME directory:/home/airflow
  • DAG directory: $HOME/airflow-git-dir/dags/
  • Config directory: $HOME/airflow-git-dir/configs/
  • Unittest directore: $HOME/airflow-git-dir/tests/. Preferable, discoverable by both nose and py.test
  • Credentials should be accessed by by some library
@josephspurrier
josephspurrier / values_pointers.go
Last active April 28, 2024 16:41
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@mgmilcher
mgmilcher / gist:5eaed7714d031a12ed97
Last active March 28, 2023 14:53
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@dougvk
dougvk / cik_dict.py
Created January 19, 2014 01:40
(stock ticker -> CIK) dictionary using SEC EDGAR
import re
from cPickle import dump
from requests import get
DEFAULT_TICKERS = ['goog', 'aapl']
URL = 'http://www.sec.gov/cgi-bin/browse-edgar?CIK={}&Find=Search&owner=exclude&action=getcompany'
CIK_RE = re.compile(r'.*CIK=(\d{10}).*')
cik_dict = {}
for ticker in DEFAULT_TICKERS: