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
<?php | |
declare(strict_types=1); | |
/** | |
* This is a sample | |
* How to use Enum to create a custom exception cases | |
* PHP 8.1^ | |
*/ |
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
# frozen_string_literal: true | |
module Storage | |
class RemoteFileRenamer < ApplicationService | |
attr_reader :file_blob, :new_name, :file | |
# @param file [ActiveStorage::File] | |
# @param new_name [String] | |
# @param variation [Symbol] Sample: :thumbnail | |
def initialize(file, new_name, variation = nil) |
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
Use Case - Use Devise Confirmable module to confirm newly added organization(org) using email(association) | |
We want Three things to work - | |
Use confirmable - send_confirmation_instructions to send email when new org is added | |
Define Routes - organization_confirmation_url, so that user can use this route to confirm the org | |
Add confirmable columns inside existing organizations table, update token,timestamps on db | |
====== HERE WE START ========= | |
- `organization.rb` | |
has_one :contact_detail ##contains email |
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
<template> | |
<Page class="page"> | |
<ActionBar class="action-bar" title="Miyha"> | |
<NavigationButton text="Menu" icon="res://ic_list_black_24dp" @tap="toggleDrawer" /> | |
<StackLayout orientation="horizontal"> | |
<Image src="res://icon" width="40" height="40" verticalAlignment="center" /> | |
<Label text="iyha" fontSize="24" verticalAlignment="center" /> | |
</StackLayout> | |
</ActionBar> | |
<SideDrawer> |
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
const axios = require('axios') | |
/* ... */ | |
const params = new URLSearchParams() | |
params.append('name', 'Akexorcist') | |
params.append('age', '28') | |
params.append('position', 'Android Developer') | |
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/') | |
params.append('awesome', true) |
First, run:
$ composer config --list --global //this will get the composer home path.
[home] /root/.composer //it's my composer home path.
And then, edit the config.json in [home]
directory, make it like this:
{
"config": {
"github-protocols": [
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "JSON API Schema", | |
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org", | |
"oneOf": [ | |
{ | |
"$ref": "#/definitions/success" | |
}, | |
{ | |
"$ref": "#/definitions/failure" |
NewerOlder