Skip to content

Instantly share code, notes, and snippets.

@MattWilcox
MattWilcox / build_nginx.sh
Last active March 6, 2022 18:01
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@SlavaMelanko
SlavaMelanko / upstream-prerequisites.md
Last active October 7, 2020 00:20
Upstream Prerequisites

Requirements are statements about an intended product which specify what it should do or how to do it. For requirements to be effectively implemented and measured, they must be specific, unambiguous and clear.

  • Business
    • Business objectives
    • Sponsor point of view
    • Scope of the project
  • User
    • User point of view
    • User goals
  • User inputs and outputs
unless Rails.env.production?
bot_files = Dir[Rails.root.join('app', 'messenger_bot', '**', '*.rb')]
bot_reloader = ActiveSupport::FileUpdateChecker.new(bot_files) do
bot_files.each{ |file| require_dependency file }
end
ActionDispatch::Callbacks.to_prepare do
bot_reloader.execute_if_updated
end
@victusfate
victusfate / canvas_bkg.js
Created June 28, 2012 16:08
creates a dynamic color pattern canvas on mouse move event
var body, canvas, color, ctx, grad, canvasAdjust=true;
canvas = document.getElementsByTagName("canvas")[0];
ctx = null;
grad = null;
body = document.getElementsByTagName("body")[0];
color = 255;
if (canvas.getContext("2d")) {
var w = canvas.width;
var h = canvas.height;
ctx = canvas.getContext("2d");