Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
★Think Big-Create Big-Choice Big★

MD Iyasin Arafat miyasinarafat

:octocat:
★Think Big-Create Big-Choice Big★
View GitHub Profile
@miyasinarafat
miyasinarafat / roles_investigation.md
Created Aug 16, 2020 — forked from mooniker/roles_investigation.md
Roles and permissions system for Nodejs
View roles_investigation.md

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

View what-hiring-should-look-like.md

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.

View alpine-to-vue.md

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 Nov 6, 2019
Handling form request with axios and custom classes in Vue app.
View AxiosFormHandling.js
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
/**
@miyasinarafat
miyasinarafat / Container.php
Last active Aug 29, 2019
PHP Dependency Injection Container wtih PHP Reflection API
View Container.php
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/
protected $instances = [];
View botman-mobile-textbox.md

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 Jul 22, 2019
How to organizing Laravel console commands. Gist from this tweet: https://twitter.com/ascheron/status/1153237533695860737
View Kernel.php
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
View Basic unit-of-work for Laravel
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
View To enable extensions, verify that they are enabled in your .ini
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
@miyasinarafat
miyasinarafat / curl-multi-test.php
Created May 31, 2019 — forked from gilbitron/curl-multi-test.php
Testing 95 regular curl_exec requests vs curl_multi_exec requests
View curl-multi-test.php
<?php
$sites = [
'http://www.google.com/',
'http://www.facebook.com/',
'http://www.youtube.com/',
'http://www.yahoo.com/',
'http://www.live.com/',
'http://www.wikipedia.org/',
'http://www.baidu.com/',