Skip to content

Instantly share code, notes, and snippets.

View ak4bento's full-sized avatar
🎧
Always Happy

Muhammad Akil ak4bento

🎧
Always Happy
View GitHub Profile
javascript: (function() {
var url = prompt('URL of script to inject:');
if (url) {
console.log('Script inject request URL:', url);
var script = document.createElement('script');
script.src = url;
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@ak4bento
ak4bento / staff working
Created January 22, 2019 03:48
working hours
<el-table-column min-width="150px" label="Sunday" prop="sunday" align="center" >
<template slot-scope="scope">
<span v-if="scope.row.working_hours[0] != null">
<span v-for="(item, index) in scope.row.working_hours" v-if="item.working_hours_day == 1" :key="index" >
<!-- <span v-if="item.working_hours_day == 1"> -->
<el-button style="background: #FBFBFB">
{{ item.shift_start_time }} - {{ item.shift_end_time }} <br>
</el-button> <br>
<!-- </span> -->
</span>
@ak4bento
ak4bento / LeagueTable
Last active January 15, 2019 05:46
After each game, the clubs records their score with the recordGame function. The club points in a match are calculated using the following logic : - The winner club will receive 3 points. - Both of clubs will receive 1 point, if the game ended in a draw. - The lost club won’t receive and lose any points.
<?php
/**
* Created by PhpStorm.
* User: akill
* Date: 2019-01-15
* Time: 11:25
*/
namespace App\Http\Controllers;
@ak4bento
ak4bento / containLetters
Created January 15, 2019 05:41
implement containLetters function, given two words, returns true if all the letters of the first word are contained in the second.
public function containLetters(string $firstWord, string $secondWord)
{
$result = array();
$inc = 0;
foreach (str_split($firstWord) as $firstSplit)
{
foreach (str_split($secondWord) as $secondSplit)
{
if (strtolower($firstSplit) == strtolower($secondSplit))
{
@ak4bento
ak4bento / nginx
Created December 30, 2018 11:25
default config nginx
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@ak4bento
ak4bento / Snap
Created December 21, 2018 18:00
Example Payment With Midtrans
<?php
use Akill\Payment\Midtrans\Midtrans;
include "Midtrans.php";
include "Veritrans.php";
Midtrans::$serverKey = 'SB-Mid-server-key';
$midtrans = new Midtrans;
$transaction_details = array(
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\AppBaseController;
use Flash;
use Prettus\Repository\Criteria\RequestCriteria;
use Response;