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
| <html lang="en"> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>Video player with clickable transcript</title> | |
| <style id="jsbin-css"> | |
| #all { | |
| background-color: lightgrey; | |
| border-radius:10px; | |
| padding: 20px; |
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
| ### Taken from https://github.com/Hyperparticle/hyperparticle.github.io/blob/2365749469b1eea3e8c4b18af24a4865fc426fd3/.circleci/config.yml | |
| # Javascript Node CircleCI 2.0 configuration file | |
| # | |
| # Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
| # | |
| version: 2 | |
| jobs: | |
| build: | |
| docker: |
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
| class Contact < ActiveRecord::Base | |
| ... | |
| def after_create | |
| if Hook.hooks_exist?('new_contact', self) | |
| Resque.enqueue(Hook, self.class.name, self.id) | |
| # To trigger directly without Resque: Hook.trigger('new_contact', self) | |
| end | |
| end |
Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
- By Paul Smith March 20, 2015
- Updated by: Brett Holt May 5, 2016
Note: This guide was written for Phoenix 1.1.4. Parts of it may no longer work if you are using a newer version.
Let’s build a JSON API that serves a list of contacts. We’ll be writing it using Elixir (version 1.2.5) and Phoenix (version 1.1.4). Phoenix is a framework written in Elixir that aims to make writing fast, low latency web applications as enjoyable as possible.
Source Code: The source code after finishing this guide can be found here.
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 Fastlane | |
| module Actions | |
| class AppiumAction < Action | |
| INVOKE_TIMEOUT = 30 | |
| APPIUM_PATH_HOMEBREW = '/usr/local/bin/appium' | |
| APPIUM_APP_PATH = '/Applications/Appium.app' | |
| APPIUM_APP_BUNDLE_PATH = 'Contents/Resources/node_modules/.bin/appium' | |
| def self.run(params) | |
| Actions.verify_gem!('rspec') |
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
| class DateValidator < ActiveModel::EachValidator | |
| # EXAMPLE | |
| # class UserProfile < ActiveRecord::Base | |
| # | |
| # validates :name, presence: true | |
| # validates :birth_date, presence: true, date: {on_or_after: :birth_date_first, on_or_before: :birth_date_last} | |
| # | |
| # def self.birth_date_first |
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
| class CfValidator < ActiveModel::EachValidator | |
| # Regex for validation. It validates the code without the check-digit. | |
| # It also separates the sections with appropriate grouping. Example: | |
| # codice_fiscale =~ FORMAT_NO_CHECK_DIGIT | |
| # name, year, month, day, place = $1, $2, $3, $4, $5 | |
| # Duplication avoidance is handled | |
| FORMAT_NO_CHECK_DIGIT = /([A-Z]{6})([\dL-V]{2})([ABCDEHLMPRST])([\dL-V]{2})([A-Z][\dL-V]{3})/ | |
| # Regex for validation. It validates the code with the check-digit |
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
| class CapValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| unless value =~ /^(V-|I-)?[0-9]{5}$/ | |
| record.errors[attribute] << (options[:message] || "postcode not valid") | |
| end | |
| end | |
| end |
NewerOlder