Skip to content

Instantly share code, notes, and snippets.

View eimihar's full-sized avatar

Ahmad Rahimie eimihar

View GitHub Profile
@eimihar
eimihar / testtt.md
Last active January 27, 2023 09:52

Thank you for choosing Lenovo Premier Support

Hi, I'm contacting you in regards to your logged e-ticket, 2010451316 for your overheating issue and your buzzing sound issue.

Firstly, could you please reply to this email with a video of the buzzing noise, if possible?

Then, please perform the following:

  1. Right-click on the battery icon in Windows 10. Click on Power Options. On your current Plan, select 'Change Plan Settings'. Click on 'Change advanced power settings'. Scroll down to Processor Power Management and expand it by clicking on the '+'. Expand Maximum Processor State and change the figures for 'On battery' and 'Plugged in' from 100% to 99%. Check, does the overheating persist?

  2. https://pcsupport.lenovo.com/my/en/products/laptops-and-netbooks/thinkpad-p-series-laptops/thinkpad-p14s-gen-2-type-20vx--20vy/20vx/20vx00gvmy/pf3jkt8a/downloads please select automatic updates and scan now, to update your drivers.

@eimihar
eimihar / gist:84f35b96ff9880885f4605de76b67225
Created November 23, 2017 06:08
20 minutes arithmetic calculator
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<style type="text/css">
body {
background: #c3c3c3;
}
.body .buttons {
float: left;
width: 20%;
height: 50px;
@eimihar
eimihar / index.php
Created June 19, 2016 22:02
A code sample for youtube v=LrfbmIYAGWI
<?php
/*
GET /api/articles
POST /api/articles
GET /api/articles/:article-id
PUT /api/articles/:article-id
GET /api/articles/:article-id/author
GET /api/shops
GET /api/shops/:shop-id
GET /api/shops/:shop-id/products
@eimihar
eimihar / gist:e03a0ff71b4a148ca343a504596f39be
Last active April 14, 2016 11:14
extended eloquent model
<?php
namespace App\Entity;
abstract class Base extends \Illuminate\Database\Eloquent\Model
{
protected static function apiFields()
{
return array();
}
@eimihar
eimihar / gist:12e2bb8826769676258837a1d5b7322f
Last active April 14, 2016 08:56
method invocation on property accessed through getter
// case on accessing the data by given fields
GET /api/person/10?fields=name,address,phone,delete
// api function
$person = Entity\Person::find($id);
if(!isset($_GET['fields']))
return $person->toArray();
$fields = explode(',', $_GET['fields']);
@eimihar
eimihar / gist:d5a2a8cb4a006e8952d4
Last active August 29, 2015 14:20
Cron handling example
<?php
// filename : /var/www/thisfile.php
// cron handler
// let say this script is running every 1 minute, by crontab configure like :
// * * * * * /path/to/php /var/www/thisfile.php
$myTasks = array(
'01:20' => function()
{
// do something
var hortToVert = function(arrays)
{
var result = [];
for(var i in arrays)
{
for(var no in arrays[i])
{
if(!result[no]) result[no] = [];
result[no].push(arrays[i][no]);
}
@eimihar
eimihar / gist:c4266dcb54a30af9a272
Created January 22, 2015 17:14
Some pseudo codes of simple mvc logic handling
<?php
// Within controller
// example laravel eloquent ORM syntax
$user = user::find(1); // return \Model\User
$locations = location::findAll(); // return \Collection
$categories = category::findAll(); // return \Collection
$myform = new Form;
@eimihar
eimihar / gist:52422bd9a145955b6c41
Last active August 29, 2015 14:13
Objectified route
<?php
// same api. example of adding routes.
$app->map->addRoute(array(
'r1'=> ['uri'=> 'first-level', 'subroute'=> array(
'sr2'=> ['uri'=> 'another-sub']
)]
));
// Get route 'r1'. \Exedra\Application\Map\Route
$route = $app->map->findByName('r1');
@eimihar
eimihar / gist:e0688887ca43f41b43f0
Created November 11, 2014 05:03
Re-routing/forwarding
## routing part.
$app->addRoute(Array(
"route1"=>Array(
"method"=>"get",
"uri"=>"test",
"execute"=>function($result)
{
## forward to other route.
return $app->execute('route2',Array('my-param'=>'this is value from route1'));
}