Skip to content

Instantly share code, notes, and snippets.

void main() {
List smartBalance(double amount){
var smartBalanceList = [];
@suehok
suehok / cryptojs_aes_encryption_helper.dart
Last active May 30, 2024 08:15
Cryptojs aes password encryption helper for dart
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import 'package:crypto/crypto.dart';
import 'package:tuple/tuple.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
String encryptAESCryptoJS(String plainText, String passphrase) {
try {
final salt = genRandomWithNonZero(8);
@suehok
suehok / PostController.php
Created July 19, 2019 03:37
PostController to handle the custom publish action
<?php
namespace App\Http\Controllers\Voyager;
use TCG\Voyager\Http\Controllers\VoyagerBaseController;
use TCG\Voyager\Models\Post;
class PostController extends VoyagerBaseController
{
@suehok
suehok / web.php
Created July 19, 2019 03:24
Add Publish Route For Publish Action
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
@suehok
suehok / AppServiceProvider.php
Created July 19, 2019 03:04
Enable PublishAction when Laravel boot up
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use TCG\Voyager\Facades\Voyager;
class AppServiceProvider extends ServiceProvider
{
/**
@suehok
suehok / PublishAction.php
Last active July 19, 2019 03:10
Create new custom action in app/Actions/PublishAction.php
<?php
namespace App\Actions;
use TCG\Voyager\Actions\AbstractAction;
class PublishAction extends AbstractAction
{
public function getTitle()
{