- Make sure mysql-client is installed. If not, then :
sudo apt install mysql-client
or
sudo apt-get install mysql-client
- Open php.ini
; PHP's default character set is set to UTF-8.
| require "digest" | |
| require "rack" | |
| # This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database. | |
| # ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable. | |
| # | |
| # What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant. | |
| # If all the tenants are predefined, it can be done roughly so: | |
| # | |
| # ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling) |
| # How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli | |
| KEY_ID=alias/my-key | |
| SECRET_BLOB_PATH=fileb://my-secret-blob | |
| SECRET_TEXT="my secret text" | |
| ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob | |
| DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target | |
| encrypt-text: |
| /** | |
| * Advanced Window Snap | |
| * Snaps the Active Window to one of nine different window positions. | |
| * | |
| * @author Andrew Moore <andrew+github@awmoore.com> | |
| * @version 1.0 | |
| */ | |
| /** | |
| * SnapActiveWindow resizes and moves (snaps) the active window to a given position. |
sudo apt install mysql-client
or
sudo apt-get install mysql-client
; PHP's default character set is set to UTF-8.
| #!/bin/bash | |
| # A script to set up a new mac. Uses bash, homebrew, etc. | |
| # Focused for ruby/rails development. Includes many utilities and apps: | |
| # - homebrew, rvm, node | |
| # - quicklook plugins, terminal fonts | |
| # - browsers: chrome, firefox | |
| # - dev: iterm2, sublime text, postgres, chrome devtools, etc. | |
| # - team: slack, dropbox, google drive, skype, etc |
| import com.google.inject.BindingAnnotation; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.Target; | |
| import static java.lang.annotation.ElementType.PARAMETER; | |
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| @Target(PARAMETER) | |
| @Retention(RUNTIME) | |
| @BindingAnnotation |
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.
| var async = require("async"); | |
| var AWS = require("aws-sdk"); | |
| var gm = require("gm").subClass({imageMagick: true}); | |
| var fs = require("fs"); | |
| var mktemp = require("mktemp"); | |
| var THUMB_KEY_PREFIX = "thumbnails/", | |
| THUMB_WIDTH = 150, | |
| THUMB_HEIGHT = 150, | |
| ALLOWED_FILETYPES = ['png', 'jpg', 'jpeg', 'bmp', 'tiff', 'pdf', 'gif']; |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "net/http" | |
| "github.com/codegangsta/martini" | |
| "github.com/garyburd/redigo/redis" | |
| "github.com/martini-contrib/render" |