Skip to content

Instantly share code, notes, and snippets.

View miyasinarafat's full-sized avatar
:octocat:
★★★

MD Iyasin Arafat miyasinarafat

:octocat:
★★★
View GitHub Profile
@miyasinarafat
miyasinarafat / problem-three.cpp
Created February 7, 2023 17:09
Airwrk coding problems
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> inputs{1, 1, 2, 3, 3, 3, 4, 4, 5, 6};
auto arrSize = inputs.size();
for (int i = 0; i < arrSize; i++) {
@miyasinarafat
miyasinarafat / roles_investigation.md
Created August 16, 2020 16:37 — forked from mooniker/roles_investigation.md
Roles and permissions system for Nodejs

ACL / Roles + Permissions

Virgen-ACL (virgen-acl)

  • https://github.com/djvirgen/virgen-acl
  • "Simple in-memory ACL for node.js apps. Supports arbitrary roles and resources, including role/resource detection using a simple interface. Additionally supports custom assertions for more complex rules."
  • Comments: "Simple and elegant, create your own checks. No middleware?"

Node ACL (acl) BuildStatusDependency StatusdevDependency Status

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

Converting Tailwind UI Alpine transitions to Vue transitions

After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.

Things to be aware of:

  • Alpine calls the beginning and ending states "start" & "end"
  • Vue calls the beginning and ending states "from" and "to"
  • Alpine has inline "directives" ie x-transition:enter="classes"
  • Vue has a wrapper component that applies classes to the child
  • Alpine applies the classes you pass it for each state, :enter-start="class"
@miyasinarafat
miyasinarafat / AxiosFormHandling.js
Last active November 6, 2019 12:44
Handling form request with axios and custom classes in Vue app.
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
/**
@miyasinarafat
miyasinarafat / Container.php
Last active August 29, 2019 16:20
PHP Dependency Injection Container wtih PHP Reflection API
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/
protected $instances = [];

image of error

      let mobileHeight = window.innerHeight-64;
      if (this.props.conf.isMobile) {
        //set height of chat messages area
         let messagesElement = document.getElementsByClassName('chat')[0] as HTMLElement;
        //set height
         messagesElement.style.height = mobileHeight+'px';
 //scroll messages to bottom
@miyasinarafat
miyasinarafat / Kernel.php
Created July 22, 2019 11:01
How to organizing Laravel console commands. Gist from this tweet: https://twitter.com/ascheron/status/1153237533695860737
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
Problem 1
- laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini