Skip to content

Instantly share code, notes, and snippets.

View paulspencerwilliams's full-sized avatar

Paul Williams paulspencerwilliams

View GitHub Profile
@paulspencerwilliams
paulspencerwilliams / ensure-all-there.clj
Created October 13, 2021 19:09
Simple ns that lists files that are in one folder but not another, or different in both
(ns ensure-all-there.core
(:use clojure.data)
(:require [clj-commons.digest :as digest]))
(def jpgs-path "/Users/will/Pictures/New photography workflow/1_ingest_and_cull/jpgs-from-lightroom")
(def originals-path "/Volumes/RAID/photography/originals")
(defn files-in [folder]
(->> folder
@paulspencerwilliams
paulspencerwilliams / now.txt
Created October 27, 2017 07:59
Failure when attempting to deploy Egghead.io Redux course code to now.sh
> > redux-course@0.1.0 build /home/nowuser/src
> > react-scripts build
> Creating an optimized production build...
> Compiled successfully.
> File sizes after gzip:
> 57.9 KB build/static/js/main.73d14002.js
> 522 B build/static/css/main.6a72b013.css
> The project was built assuming it is hosted at the server root.
> To override this, specify the homepage in your package.json.
> For example, add this to build it for GitHub Pages:
@paulspencerwilliams
paulspencerwilliams / docker-compose.yml
Created July 25, 2017 07:53
Can't access docker hosted Samba container from local Mac
samba:
image: dperson/samba
command: -u "example1;badpass" -s "media;/media;no;no;no;example1" -p
ports:
- "139:139"
- "445:445"
volumes:
- ~/bcam/samba/media:/media
- ~/bcam/samba/usershares:/var/lib/samba/usershares
require 'rails_helper'
RSpec.describe ActivitiesController do
describe "GET index" do
it "assigns @activities" do
all_activities = double("all activities")
allow(Activity).to receive(:all) { all_activities }
get :index
expect(assigns(:activities)).to eq(all_activities)
end
Given Paul is a registered user
When I log in as Paul
Then I will see Paul's homepage
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7539 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14 CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 14 CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 14 CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaV
Traceback (most recent call last):
File "./pin.py", line 3, in <module>
from M2Crypto import X509
ImportError: No module named M2Crypto
-----BEGIN CERTIFICATE-----
MIIDlDCCAnygAwIBAgIEVGYhRTANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJV
UzERMA8GA1UECAwIQ29sb3JhZG8xDzANBgNVBAcMBkRlbnZlcjEaMBgGA1UECgwR
VmluZXMgWE1QUCBTZXJ2ZXIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNDExMTMx
NTM1MzNaFw0xNTExMTQxNTM1MzNaMGExCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhD
b2xvcmFkbzEPMA0GA1UEBwwGRGVudmVyMRowGAYDVQQKDBFWaW5lcyBYTVBQIFNl
cnZlcjESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAwmav/2UJklAhffbtJhAXi3y94y5+CttEBqXbdl/GYqP7xuEaf8e/
FbUqupyyyPqhv2g7fRqmpPA3zMJaVoHXF5Ixm+UdUu/0ADXLs3UMjiCydmVH9thd
2elJZbx2Nl0n5PBBMKVfh3W+i2gKTaLoz3B7YjcShDwlYv3SfHXkaS31Vden/kfy
ConnectionConfiguration connectionConfig = new ConnectionConfiguration(XMPP_HOSTNAME, 5222);
connectionConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
connectionConfig.setKeystorePath("/Users/will/src/auction_sniper_jruby/cacerts.jks");
connectionConfig.setKeystorePath("/Users/will/src/auction_sniper_jruby/ca-bundle.crt");
this.connection = new XMPPTCPConnection(connectionConfig);
this.connection.connect();
this.connection.login(format(ITEM_ID_AS_LOGIN, itemId), AUCTION_PASSWORD, AUCTION_RESOURCE);
package uk.me.paulswilliams.auction.fakes;
import org.jivesoftware.smack.*;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
import java.io.IOException;
import static java.lang.String.format;