This file contains 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 | |
namespace {{ namespace }}; | |
use Illuminate\Auth\Access\HandlesAuthorization; | |
use Illuminate\Auth\Access\Response; | |
use {{ namespacedModel }}; | |
use {{ namespacedUserModel }}; | |
class {{ class }} |
This file contains 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 | |
Route::get('test', function () { | |
//get all the files under tests/Filament | |
$files = File::allFiles(base_path('tests/Feature/Filament/Resources')); | |
foreach ($files as $file) { | |
//get the className | |
$className = str(pathinfo($file->getFilename(), PATHINFO_FILENAME))->replace('Test', ''); | |
//get the resource name | |
$modelName = str($className)->replace('Resource', ''); | |
$modelVariables = str($modelName)->camel()->plural(); |
This file contains 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
public function index() | |
{ | |
$tables = DB::select('SHOW TABLES'); | |
$defs = collect($tables) | |
->pluck('Tables_in_' . env('DB_DATABASE')) | |
->map(function ($table) { | |
$data = DB::select('SELECT * FROM ' . $table . ' LIMIT 1'); | |
return [ | |
'table' => $table, | |
'columns' => DB::select('SHOW COLUMNS FROM ' . $table), |
This file contains 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
$tests = collect(); | |
$files = File::allFiles(__DIR__ . '/../../../tests/Feature'); | |
foreach ($files as $file) { | |
$baseName = $file->getBasename('.php'); //CreatePaymentActionTest | |
$name = str($baseName)->snake()->replace('_', ' ')->title(); //Create Payment Action Test | |
$realPath = $file->getPathInfo()->getRealPath(); //Feature | |
$nameSpace = str($realPath)->explode('/tests/Feature/')->last(); | |
$levels = str($nameSpace)->explode('/'); | |
$level = $levels->count(); |
This file contains 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
import re | |
''' | |
Make sure to put | |
#F | |
as a comment at the end of lines that contain a function call that don't also contain an assignment (=). | |
''' | |
python_file = 'file.py' | |
work_file = None |
This file contains 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": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Ching Cheng Kang", | |
"label": "Programmer Internship at Softinn Solutions", | |
"image": "", | |
"email": "pycck@hotmail.com", | |
"phone": "", | |
"url": "https://www.chengkangzai.com/", | |
"summary": "Experienced Technical Assistant with a demonstrated history of working in the education management industry. Skilled in Firebase, Microsoft Word, Sales, jQuery, and Public Speaking. Strong administrative professional with a Diploma In Information & Communication Technology With Specialism In Software Engineering focused in Information & Communication Technology from Asia Pacific University of Technology and Innovation (APU / APIIT). ", |
This file contains 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
var spreadSheet = SpreadsheetApp.openById('####') | |
/** | |
* Helper Section | |
*/ | |
function ping(url) { | |
try { | |
return UrlFetchApp.fetch(url).getResponseCode(); | |
} catch (err) { | |
return 500; | |
} |
This file contains 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
var User = require('../models/user'); | |
var jwt = require('jsonwebtoken'); | |
var config = require('../config/config'); | |
var request = require('request-promise-native'); | |
generateToken = user => { | |
return jwt.sign( | |
{ id: user.id, username: user.username }, | |
config.jwtSecret, | |
{ |