- Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
| Spree::CheckoutController.class_eval do | |
| def before_address | |
| # If the user has a default address, a callback takes care of setting | |
| # that; but if he doesn't, we need to build an empty one here. | |
| # Regardless of checkout steps, build a shipping address | |
| @order.bill_address ||= Spree::Address.build_default | |
| @order.ship_address ||= Spree::Address.build_default | |
| end |
sudo vim /etc/postfix/sasl_passwd
| module Spree | |
| class Gateway::NewGateway < Gateway | |
| preference :login, :string | |
| preference :password, :string | |
| preference :signature, :string | |
| preference :currency_code, :string | |
| def provider_class | |
| ActiveMerchant::Billing::New | |
| end |
| echo master shard_{0,1,2,3} | xargs -n1 /usr/local/bin/dropdb -p 6432 -h /tmp -U postgres | |
| echo master shard_{0,1,2,3} | xargs -n1 /usr/local/bin/createdb -p 6432 -h /tmp -U postgres | |
| for a in {0..3}; do | |
| echo " | |
| CREATE TABLE users (id serial PRIMARY KEY, username TEXT NOT NULL); | |
| ALTER SEQUENCE users_id_seq INCREMENT BY 4 RESTART WITH $a; | |
| " | /usr/local/bin/psql -p 6432 -h /tmp -U postgres -d shard_$a; | |
| done |
| private class HttpUploadImageTask extends AsyncTask<String, Void, Boolean> { | |
| final Bitmap imageBitmap; | |
| public HttpUploadImageTask(final Bitmap imageBitmap) { | |
| this.imageBitmap = imageBitmap; | |
| } | |
| @Override | |
| protected Boolean doInBackground(String... urls) { | |
| for (final String u : urls) { | |
| try { |
Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.
This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016
| #! /bin/sed -f | |
| # remove configuration settings | |
| /^SET /d | |
| # remove comments | |
| /^--/d | |
| # remove sequence values | |
| /^SELECT pg_catalog.setval/d |
| class AddBackgroundToSpreeTaxons < ActiveRecord::Migration | |
| def change | |
| add_column :spree_taxons, :background_file_name, :string | |
| add_column :spree_taxons, :background_content_type, :string | |
| add_column :spree_taxons, :background_file_size, :integer | |
| add_column :spree_taxons, :background_updated_at, :timestamp | |
| end | |
| end |
| package main | |
| import ( | |
| "archive/tar" | |
| "compress/gzip" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "path" | |
| ) |