Skip to content

Instantly share code, notes, and snippets.

Benjamin Humphrey humphreybc

Block or report user

Report or block humphreybc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@humphreybc
humphreybc / free_email_providers.conf
Last active May 22, 2019
List of free email providers
View free_email_providers.conf
0-mail.com
027168.com
0815.su
0sg.net
10mail.org
10minutemail.co.za
11mail.com
123.com
123box.net
123india.com
@humphreybc
humphreybc / configuration.js
Last active Jun 13, 2018
Webpack 3 configuration for Dovetail
View configuration.js
// Common configuration for webpacker loaded from config/webpack/paths.yml
const { join, resolve } = require("path");
const { env } = require("process");
const { safeLoad } = require("js-yaml");
const { readFileSync } = require("fs");
const configPath = resolve("config", "webpack");
const loadersDir = join(__dirname, "loaders");
const paths = safeLoad(readFileSync(join(configPath, "paths.yml"), "utf8"))[env.NODE_ENV];
@humphreybc
humphreybc / droppable.tsx
Last active May 31, 2018
Dovetail NoteGroup component
View droppable.tsx
import * as csx from "csx";
import { types } from "dovetail/graphql";
import { NoteGroupColor } from "dovetail/types";
import { NoteSortDropdownChoice } from "dovetail/ui/dropdown/NoteSortDropdown";
import { OutsideClick } from "dovetail/ui/layout/OutsideClick";
import { NewNoteItem } from "dovetail/ui/note";
import { CreateNoteItem } from "dovetail/ui/note/CreateNoteItem";
import { Cache } from "dovetail/ui/util/Cache";
import { makeStyleSafe } from "dovetail/util/reactBeautifulDnd";
import * as text from "dovetail/util/text";
View deferred-example.js
var events = [];
window.track = events.push.bind(events);
document.addEventListener("DOMContentLoaded", function() {
window.track = function(name) {
mixpanel.track(name)
};
events.forEach(mixpanel.track);
});
View website.html.haml
!!! XML
!!!
%html{ lang: 'en' }
%head
= javascript_include_tag 'website', defer: 'defer'
View pages_controller.rb
class PagesController < ApplicationController
layout 'website'
end
View style.css
body {
font-family: font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
View assets_helper.rb
module AssetsHelper
def inline_file(path)
if assets = Rails.application.assets
asset = assets.find_asset(path)
return '' unless asset
asset.source
else
File.read(File.join(Rails.root, 'public', asset_path(path)))
end
end
View production.rb
config.public_file_server.headers = {
'Cache-Control' => 'public, s-maxage=31536000, maxage=15552000',
'Expires' => "#{1.year.from_now.to_formatted_s(:rfc822)}"
}
You can’t perform that action at this time.