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
| import Foundation | |
| fileprivate let queue = DispatchQueue(label: "FileMonitorQueue", target: .main) | |
| enum FileWatcherError: Error { | |
| case directoryOpenFailed(Int32) | |
| case directoryURLInvalid(URL) | |
| } | |
| final class FileWatcher { |
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
| ;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
| ;; This file is loaded by Spacemacs at startup. | |
| ;; It must be stored in your home directory. | |
| (defun dotspacemacs/layers () | |
| "Layer configuration: | |
| This function should only modify configuration layer settings." | |
| (setq-default | |
| ;; Base distribution to use. This is a layer contained in the directory | |
| ;; `+distribution'. For now available distributions are `spacemacs-base' |
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
| module AdminPageLayoutOverride | |
| def build_page(*args) | |
| within super do | |
| render "layouts/environment" | |
| end | |
| end | |
| end | |
| ActiveAdmin::Views::Pages::Base.send :prepend, AdminPageLayoutOverride |
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
| > tsc && npm run minify | |
| node_modules/@types/node/index.d.ts:75:11 - error TS2300: Duplicate identifier 'IteratorResult'. | |
| 75 interface IteratorResult<T> { } | |
| ~~~~~~~~~~~~~~ | |
| node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6 | |
| 41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>; | |
| ~~~~~~~~~~~~~~ |
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
| # If your options hash is stored in @options | |
| attr_accessor :options | |
| def method_missing(meth,*args,&prc) | |
| if options.keys.include?(meth.to_sym) | |
| options[meth.to_sym] | |
| elsif options.keys.include?(meth[0...-1].to_sym) && meth[-1] == "=" | |
| options[meth[0...-1].to_sym] = args.first | |
| else |
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
| // ProductDelegate | |
| import UIKit | |
| protocol ProductDelegate: NSObjectProtocol { | |
| func didReceiveProduct(product: Product) | |
| func didReceiveProductImage(image: UIImage) | |
| } | |
| // ProductController |
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
| data EventWithDistance = EventWithDistance | |
| { eventWithDistanceId :: Int | |
| , eventWithDistanceEndedAt :: LocalTime | |
| , eventWithDistanceName :: T.Text | |
| , eventWithDistanceStartedAt :: LocalTime | |
| , eventWithDistanceUserId :: Int | |
| , eventWithDistanceAddress :: T.Text | |
| , eventWithDistanceLat :: Float | |
| , eventWithDistanceLon :: Float | |
| , eventWithDistanceDistance :: Float |
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
| intOrUppercase = (const () <$> posInt) <|> (const () <$> (satisfy isUpper)) |
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
| (ns gol-clojure.core-test | |
| (:use clojure.contrib.mock) | |
| (:require [clojure.test :refer :all] | |
| [gol-clojure.core :refer :all])) | |
| (deftest new-val-test | |
| (testing "new-val" | |
| (testing "when the center cell is dead" | |
| (testing "with exactly 3 alive neighbors" | |
| (let [matrix [[1 1 1] [0 0 0] [0 0 0]]] |
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' | |
| class S3Copy | |
| attr_reader :from_bucket, :to_bucket | |
| def initialize(from_bucket, to_bucket) | |
| access_key = ENV['AWS_ACCESS_KEY_ID'] | |
| secret_key = ENV['AWS_SECRET_ACCESS_KEY'] | |
| s3_instance = AWS::S3.new(access_key_id: access_key, secret_access_key: secret_key) |