Skip to content

Instantly share code, notes, and snippets.

View yokesharun's full-sized avatar
😬
Happy

Arun Yokesh yokesharun

😬
Happy
View GitHub Profile
@yokesharun
yokesharun / domain_compare.php
Created February 9, 2016 07:37
PHP compare the domain with two urls and match it
<?php
$url1 = parse_url("http://www.google.co.uk");
$url2 = parse_url("http://www.google.co.uk/pages.html");
if ($url1['host'] == $url2['host']){
//matches
}else{
// not matches
}
@yokesharun
yokesharun / laravel-package
Created February 19, 2016 07:53 — forked from anistark/laravel-package
Packaging of Laravel website
So, you're done making the website or web-app and now you would wanna distribute it to your clients. Awesome. Let's go ahead and create a package for the same.
There are two types of packaging that can be done in laravel:
1. VPS
2. Shared
VPS
VPS version is for their own use and local testing. So, you would wanna keep it as close to your local system settings as possible.
1. Delete all the files from app/storage/ in the following folders:
cache
@yokesharun
yokesharun / sublimeText.md
Created February 19, 2016 07:57 — forked from anistark/sublimeText.md
Setup Sublime Text

Install via the Package Manager(apt-get):

Simply add to your packages:

For Sublime-Text-2:

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
@yokesharun
yokesharun / LampSetup.md
Created February 19, 2016 07:57 — forked from anistark/LampSetup.md
LAMP Setup

Install Apache

sudo apt-get update
sudo apt-get install apache2

Install Mysql

@yokesharun
yokesharun / android_screen_size_list.md
Last active March 17, 2016 11:10
Android Icons and splash screen Sets Size - PhoneGap

Application icon size list

36x36 -- ldpi

48x48 -- mdpi

72x72 -- hdpi

96x96 -- xhdpi

@yokesharun
yokesharun / tmux-cheatsheet.markdown
Last active April 1, 2016 14:10 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yokesharun
yokesharun / List.md
Created July 29, 2016 16:16 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@yokesharun
yokesharun / notes.md
Last active August 11, 2016 07:07
API Token Authentication in Laravel 5.2

I recently had the need to write a small url shortening application. I am aware that this problem has been solved quite a few times before, but what is being a developer if not reinventing the wheel just for the heck of it? Custom CMS anyone?

Knowing that this was going to be a tiny RESTful API and also knowing that Laravel 5.2 had API rate limiting built in, I was eager to give it a try. Taylor Otwell being Taylor Otwell shipped 5.2 with the rate limiting defaults set up out of the box and I had my application building out short url's in a matter of minutes. The problem for me came when I wanted to start associating those short urls with a user.

Typically my applications have a UI and authentication is done through a simple login page. Obviously for a RESTful API, having a login page isn't ideal. Instead, my hope was to have users append an api_token to the end of their query string and use that to authenticate their request. I was happy to find that 5.2 also ships with a TokenGuard(link) class that allows

@yokesharun
yokesharun / swift.md
Created September 27, 2016 13:12
Awesome Swift iOS Full Detailed libraries list
@yokesharun
yokesharun / file.php
Created March 2, 2017 13:39
Get Hour difference between two dates
$hourdiff = round((strtotime($time1) - strtotime($time2))/3600, 1);
echo $hourdiff;