###So you want to become a full-stack developer: What? Why?
###For beginners:
| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # @kyletcarlson | |
| # | |
| # This skeleton also assumes you're using the following gems: |
| brew cask install skype | |
| brew cask install MacDown | |
| brew cask install screenhero | |
| brew cask install virtualbox | |
| brew cask install font-inconsolata | |
| brew cask install font-Consolas | |
| brew cask install font-source-code-pro | |
| brew cask install swiggle | |
| brew cask install vlc | |
| brew cask install geektool |
###So you want to become a full-stack developer: What? Why?
###For beginners:
| public void copyFileOrDir(String path) { | |
| AssetManager assetManager = this.getAssets(); | |
| String assets[] = null; | |
| try { | |
| assets = assetManager.list(path); | |
| if (assets.length == 0) { | |
| copyFile(path); | |
| } else { | |
| String fullPath = "/data/data/" + this.getPackageName() + "/" + path; | |
| File dir = new File(fullPath); |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
| Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build. | |
| ################################################# | |
| # Enable remote ssh access to travisci build for debugging | |
| ################################################# | |
| # Add a key so we can login to travisci vm | |
| - cat ssh/travisci.pub >> ~/.ssh/authorized_keys | |
| - chmod 600 ssh/travisci | |
| # Install netcat |
| def deflate(arr, container = []) | |
| arr.each do |a| | |
| push(a, container) | |
| end | |
| container | |
| end | |
| def push(a, container) | |
| if a.is_a? Integer |
| # frozen_string_literal: true | |
| require "httparty" | |
| class FirebaseMessaging | |
| include HTTParty | |
| default_timeout 30 | |
| format :json | |
| base_uri "https://fcm.googleapis.com/fcm" |
| RSpec::Matchers.define :validate_with do |expected_validator| | |
| match do |subject| | |
| @validator = current_validator(subject, expected_validator) | |
| if @validator.options.present? | |
| @validator.options.all? do |_, condition| | |
| subject.instance_eval(&condition) | |
| end | |
| end | |
| end |