Skip to content

Instantly share code, notes, and snippets.

View khrlimam's full-sized avatar

Khairul Imam khrlimam

View GitHub Profile
<?php
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
static::$poolName => 'required|string',
<?php
/**
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return Authenticatable|null
*/
public function retrieveById($identifier)
{
return session($identifier, null);
<?php
/**
* Validate a user against the given credentials.
*
* @param Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
import random
import torch
import pathlib
import os
from torch.utils import data
import PIL
import PIL.Image
from collections import defaultdict
from bisect import insort_right
package app.submissions.dicoding.footballmatchschedule
import android.annotation.SuppressLint
import android.content.Context
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import bisect
n = int(input(''))
n_scores = input('')
n_scores = map(int, n_scores.split())
m = int(input(''))
m_scores = input('')
m_scores = map(int, m_scores.split())
@khrlimam
khrlimam / v_net_graph.php
Created May 8, 2018 14:33
Laravel Irham
<?php
$data = Model::all();
$graphData = $data->map(function($item, $key) {
return [
'y' => $item->net_lending,
'name' => $item->nama_cab
];
});
@khrlimam
khrlimam / challenges2.py
Last active May 11, 2018 11:48
LombokDev Challenges #2
def valid_n(n):
return 2 < n < 10
def valid_z(z):
return 1 < z < 100000
def F(x, y, z, n):
value = x**n + y**n - z**n
antRoutes = [
[1,2,9,10,25,26],
[4,3,8,11,24,27],
[5,6,7,12,23,28],
[16,15,14,13,22,29],
[17,18,19,20,21,30],
[36,35,34,33,32,31]
];
detik = input('Semut di detik berapa? ')
mkdir build &&
cd build &&
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_CXX11=ON \
-DBUILD_PERF_TESTS=OFF \
-DWITH_XINE=ON \
-DBUILD_TESTS=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \