This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This script works well with Photoshop CC 2017 | |
| // Adopted from stackoverflow.com/questions/14571008/photoshop-scripting-changing-text-of-a-text-layer | |
| Array.prototype.forEach = function (fn) { | |
| for (var i = 0; i < this.length; i++) { | |
| fn(this[i], i); | |
| } | |
| }; | |
| var doc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/graphql/types/objects/document_type.rb | |
| module Mutations | |
| class CreateDocument < BaseMutation | |
| description "creates a document for the user in the system" | |
| argument :doc, ApolloUploadServer::Upload, required: true | |
| field :document, Types::Objects::DocumentType, null: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "open-uri" | |
| require "net/http" | |
| Error = Class.new(StandardError) | |
| DOWNLOAD_ERRORS = [ | |
| SocketError, | |
| OpenURI::HTTPError, | |
| RuntimeError, | |
| URI::InvalidURIError, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "aws-sdk-s3" | |
| class BucketSyncService | |
| attr_reader :from_bucket, :to_bucket, :logger | |
| attr_accessor :debug | |
| def initialize(from_bucket, to_bucket) | |
| @from_bucket = bucket_from_credentials(from_bucket) | |
| @to_bucket = bucket_from_credentials(to_bucket) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :first-child i === 0 | |
| :last-child i === arr.length - 1 | |
| :only-child arr.length === 1 | |
| :nth-child(even) i % 2 | |
| :nth-child(odd) !(i % 2) | |
| :nth-child(n) i === n - 1 | |
| :nth-last-child(n) i === arr.length - n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| RELEASES_URL=https://johnvansickle.com/ffmpeg/releases/ | |
| RELEASE_TYPE=64bit | |
| RELEASE_VERSION=3.4.0 | |
| UNTARRED_NAME="ffmpeg-${RELEASE_VERSION}-${RELEASE_TYPE}-static" | |
| TAR_NAME="ffmpeg-release-${RELEASE_TYPE}-static.tar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Adapted from | |
| # https://gist.github.com/bf4/5594532#file-validations-rb-L5 | |
| # https://speakerdeck.com/erniemiller/an-intervention-for-activerecord?slide=117 | |
| # Per https://github.com/rails/rails/blob/5-1-stable/activerecord/lib/active_record/validations/uniqueness.rb#L140-L147 | |
| # Using this validation method in conjunction with | |
| # {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] | |
| # does not guarantee the absence of duplicate record insertions, | |
| module ActiveRecordUniquenessExceptions | |
| # @example error message | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew cask install osxfuse (requires a reboot after installation completes) | |
| brew install s3fs | |
| create a password file: | |
| echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ~/.passwd-s3fs | |
| chmod 600 ~/.passwd-s3fs | |
| (replace ACCESS_KEY_ID and SECRET_ACCESS_KEY with the actual AWS values) | |
| (password file should only contain a single line with the two values separated by a colon) | |
| create a local folder to serve as mount point - this will be the folder name you reference to access the S3 bucket. |