dev bit of Gemfile
group :development, :test do
gem "rspec-rails"
gem 'capybara'
gem 'factory_girl_rails'
gem 'forgery'
gem "database_cleaner"
gem "mongoid-rspec"| module Admin::V1 | |
| class ApiController < ApplicationController | |
| include Authenticable | |
| def render_error(message: nil, fields: nil, status: :unprocessable_entity) | |
| errors = {} | |
| errors['fields'] = fields if fields.present? | |
| errors['message'] = message if message.present? | |
| render json: { errors: errors }, status: status |
| class CocktailsController < ApplicationController | |
| def index | |
| @cocktails = Cocktail.all | |
| end | |
| def show | |
| @cocktail = Cocktail.find(params[:id]) | |
| @dose = Dose.new | |
| @review = Review.new | |
| end |
dev bit of Gemfile
group :development, :test do
gem "rspec-rails"
gem 'capybara'
gem 'factory_girl_rails'
gem 'forgery'
gem "database_cleaner"
gem "mongoid-rspec"| More recent resolution: | |
| 1. cd ~/../../etc (go to etc folder in WSL). | |
| 2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
| 3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
| 4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
| 5. cd ~/../../etc (go to etc folder in WSL). | |
| 6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
| 7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
| secondary. |
| const addHours = (d,h) => d.getTime() + (h * 3600000); | |
| let start = new Date(addHours(new Date(), 1)); | |
| let finish = new Date(addHours(start, 8)); | |
| const handleHourChange = (startHour) => { | |
| start = new Date(); | |
| start.setHours(startHour); | |
| finish = addHours(start, 8); | |
| permittedHours(); |
The last SDK is available in https://dl.google.com/android/repository/platform-tools-latest-windows.zip
Please do a favor to yourself and dont extract to root of your C drive.
| -- check indexes in a table | |
| select * | |
| from pg_indexes | |
| where tablename like 'my_table'; | |
| -- Check then statistics were reseted | |
| SELECT stats_reset | |
| FROM pg_stat_database | |
| WHERE datname = current_database(); |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
| "use client" | |
| import * as React from "react" | |
| import { buttonVariants } from "@/components/ui/button" | |
| import { ScrollArea } from "@/components/ui/scroll-area" | |
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" | |
| import { cn } from "@/lib/utils" | |
| import { ChevronLeft, ChevronRight } from "lucide-react" | |
| import { DayPicker, DropdownProps } from "react-day-picker" |