Skip to content

Instantly share code, notes, and snippets.

@rolux
rolux / godard_mieville.py
Created Dec 7, 2020
python script, unedited, used to create https://youtu.be/X2ryBq31pHs
View godard_mieville.py
from __future__ import division, print_function
import math
from oxmaps import Line, Pano, PanoImage, PanoTile, Point, db
from PIL import Image
ids = [
'eGYyAlN9kvBEg6AYtJV60A',
'CCQWTbDqYokwHNwBWnl8wQ',
'_UBAlMtHNb7hUYpxXkmcCA',
'tBMPwhLVH4Kk8EdQc15-3w',
@jbenet
jbenet / propose-ipfs-pack.md
Created Dec 23, 2016
ipfs-pack and friends
View propose-ipfs-pack.md

IPFS Tooling for datasets

Background

We need some tooling for a certain set of use cases around archival and dataset management. This tooling is for fitting how people work with large files and large datasets.

Grounding Assumptions

Basic grounding assumptions here:

  • datasets are "large" (From GB to EB in size)
@levibostian
levibostian / post.md
Last active Apr 15, 2020
webpack, Tachyons, pug, Vue.js web app.
View post.md

Today, single page web apps are driving many websites that we use each and every day. Instead of having your browser request a new web page for each and every action you perform on a web page, single page web apps may load all in one request to smoothly and quickly transition with every action you perform.

When building single page web apps, you may decide to retrieve all of the HTML, CSS and Javascript with one single page load or dynamically load these resources as the user moves about your site. Either way, it can be a pain to bundle all of these assets together for the end user to download from your web server. This is where webpack comes into play.

webpack does all of the heavy lifting bundling all of your HTML, CSS and Javascript together. If you write your site all from scratch or depend on dependencies from npm, webpack takes care of packaging it all together for you. It has the ability to take your single page web app, cut out all of the code you don't need, then packa

@renchap
renchap / README.md
Last active Sep 21, 2021
One-line certificate generation/renews with Letsencrypt and nginx
View README.md

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@iamralch
iamralch / sshtunnel.go
Last active Sep 20, 2021
SSH tunnelling in Golang
View sshtunnel.go
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@cyberbobs
cyberbobs / MenuBackIcon.qml
Created Nov 16, 2014
Animated hamburger-back icon in Material Design style done in QML
View MenuBackIcon.qml
import QtQuick 2.2
Item {
id: root
width: 24
height: 24
Rectangle {
id: bar1
x: 2
@pankajp
pankajp / serve_http.py
Last active Aug 27, 2021
Simple Python HTTP Server with multi-threading and partial-content support
View serve_http.py
#! /usr/bin/env python
# Standard library imports.
from SocketServer import ThreadingMixIn
import BaseHTTPServer
import SimpleHTTPServer
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext,
@cuibonobo
cuibonobo / eve-event-hooks.py
Created Mar 30, 2014
A good example of using event hooks to modify Eve data. Taken from: https://github.com/nicolaiarocci/eve/issues/270
View eve-event-hooks.py
# settings
settings = {...}
# authentication
from eve.auth import TokenAuth
import requests
from flask import request, g
class TokenAuth(TokenAuth):
def check_auth(self, token, allowed_roles, resource, method):
# check token against user api
@plentz
plentz / nginx.conf
Last active Sep 24, 2021
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@algal
algal / nginx-cors.conf
Created Apr 29, 2013
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
View nginx-cors.conf
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests