I thought I would document my setup, since it's somewhat non-standard but working quite well for me.
- Install major Ruby versions at their latest patch release
- Allow to switch between them seamlessly
- Use chruby
- Encourage bundler usage
#!/bin/bash | |
# Parameters | |
socket="/run/foo.sock" | |
dump="/tmp/capture.pcap" | |
# Extract repetition | |
port=9876 | |
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig" |
AllCops: | |
RunRailsCops: true | |
# Commonly used screens these days easily fit more than 80 characters. | |
Metrics/LineLength: | |
Max: 120 | |
# Too short methods lead to extraction of single-use methods, which can make | |
# the code easier to read (by naming things), but can also clutter the class | |
Metrics/MethodLength: |
Hacking CORS restriction to enable in-browser XHR to any server.
Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80
, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.
Run:
python/ | |
*.log |
# This is not a complete Nginx configuration! It only shows the relevant parts for integrating Diaspora. | |
# [...] | |
http { | |
# Your standard server configuration goes here | |
# [...] | |
gzip_static on; |
#!/usr/bin/env ruby | |
# List of spam accounts | |
spam_accounts = %w(spamacc@podA spamacc@podB spamacc@mypod) | |
# Delete comments even if spammer isn't a local user or spam isn't on a | |
# local users account. | |
# And delete posts of users in spam_accounts that aren't local. | |
always_delete = true |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Barcode generator</title> | |
<script src="https://cdn.jsdelivr.net/jsbarcode/3.5.8/JsBarcode.all.min.js"></script> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
window.eanHistory = []; | |
function loadHistory() { |
echo -e "\n$(curl -L https://gist.github.com/jhass/66f02fe5044fa720c623/raw/cert-authority.pub)\n" >> ~/.ssh/authorized_keys |