Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Berkopec nateberkopec

View GitHub Profile
@tenderlove
tenderlove / h2_puma.rb
Last active Apr 26, 2019
Demo HTTP/2 server with Puma
View h2_puma.rb
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
View config_for.rb
module YourApp
class Application < Rails::Application
# Convenience for loading config/foo.yml for the current Rails env.
#
# Example:
#
# config/cleversafe.yml:
#
# production:
# url: http://127.0.0.1:8080
@tomfuertes
tomfuertes / 0.result.md
Last active May 11, 2016
De-'Async Inject'ing Universal Analytics
View 0.result.md

De-'Async Inject' Universal Analytics

This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head> of your document

<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
  (function(e,t){e.GoogleAnalyticsObject=t;e[t]=e[t]||function(){
     (e[t].q=e[t].q||[]).push(arguments)};e[t].l=1*new Date})(t,"ga");
  ga('create', 'UA-XXXX-Y'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
View install-ebook-convert.md

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre
@p01
p01 / LICENSE.txt
Last active Feb 1, 2021 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE