Skip to content

Instantly share code, notes, and snippets.

Using Dat with a github.io domain

https://i.imgur.com/akOrIOq.png

My personl site is hosted at hashbase.io (link) so that you can access it via dat and https. My canonical dat url is dat://pfrazee.hashbase.io.

Before I used hashbase I used Github Pages, and today it dawned on me that I can have dat://pfrazee.github.io work too. It's pretty simple if you know the dat dns spec.

All I had to do was add /.well-known/dat to my site (click to view). I put the raw dat URL of my site in that file, along with a TTL.

Install

npm install funcoffee

Require

require('funcoffee').expose global
@alexchung
alexchung / Blockout.py
Created February 9, 2014 23:11
Blockout encryption/decryption methods ported to Python
# -*- coding: utf-8 -*-
import sys
import os
import base64
import bcrypt
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
class Blockout:
@una
una / SassMeister-input-HTML.html
Created November 15, 2013 05:44
Generated by SassMeister.com.
<!-- @una made this -->
<ul class="color-list">
<li class="color-box brick-red"></li>
<li class="color-box strawberry"></li>
<li class="color-box deep-orange"></li>
<li class="color-box tangerine"></li>
<li class="color-box gold"></li>
<li class="color-box sunshine"></li>
<li class="color-box grass-green"></li>
@scottkellum
scottkellum / SassMeister-input.sass
Created October 15, 2013 16:44
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.7)
// ----
=e($name)
@at-root #{&}__#{$name}
@content
=m($name)
@at-root #{&}--#{$name}
@clifff
clifff / dogs.markdown
Created October 9, 2013 20:48
dog gifs

@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@svallory
svallory / sass-one-time-importer.rb
Last active December 18, 2015 21:58
Sass custom importer which only imports the same file once. Requires colorize to make it easy to debug. You can remove it safely (but make sure to remove all the .red, .blue etc. calls also)
require 'colorize'
module Liftr
module Importers
class ImportOnce < ::Sass::Importers::FilesystemFilesystem
attr_accessor :root, :debug_level, :staleness_check, :imported, :original_filename
# Creates a new filesystem importer that imports files relative to a given path.
#
@joyrexus
joyrexus / ives.coffee.md
Last active October 25, 2018 07:13
Self-interpolating-litcoffee rendering hack.

St Ives

class Slider
  constructor: (@i, @range) -> 
    @ui = '<span class="slider">' + @i + '</span>'

slider = (i, range) -> new Slider i, range

There are #{sacks} sacks
Every sack had #{cats.ui} cats

@blackfalcon
blackfalcon / sassJunkDrawer.md
Last active March 23, 2022 20:09
Clean out your Sass junk-drawer

by Dale Sande

CSS has had a long and sordid past. A developer never sets out with the goal of making a complete and total mess of things. Their intention is not to build something that is practically illegible, impractical to maintain and is limited in scale. But somehow, this is where many inevitably end up. Luckily, all is not lost. With some simple strategies, organizational methods and out-of-the box tools, we can really help get that junk-drawer inline.

For many of us getting started with Sass, at one time or another have created a junk-drawer of files. For most, this was a rookie mistake, but for others, this is a continuing issue with our architecture and file management techniques. Sass doesn't come with any real rules for file management so developers are pretty much left to their own devices.

Large CSS files and increased complexity

CSS started out with very simple intentions, but as [tableless web design][1.1] began to really take a foothold, o