Skip to content

Instantly share code, notes, and snippets.

View gayanhewa's full-sized avatar
🦧
I may be slow to respond.

Gayan gayanhewa

🦧
I may be slow to respond.
View GitHub Profile
@gayanhewa
gayanhewa / Guide
Created August 28, 2015 18:11
Arch Linux Installation - UEFI Configuration steps
Simple steps for me to remember how I did this
==============================================
1. Partition
/root - /dev/sdx2 - Ext4 parition
/boot/efi - /dev/sdx1 - EFI partition
2. Install the system
3. chroot to the system

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
gayan@gayan-laptop:~/Workspace/personal$ git clone -b develop https://github.com/laravel/laravel.git
Cloning into 'laravel'...
remote: Reusing existing pack: 21846, done.
remote: Total 21846 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (21846/21846), 8.50 MiB | 116.00 KiB/s, done.
Resolving deltas: 100% (10882/10882), done.
Checking connectivity... done.
gayan@gayan-laptop:~/Workspace/personal$ clear
gayan@gayan-laptop:~/Workspace/personal$ ls
git-test laravel last-min.-shopping magelk-charity taskrapp
<?php
class TestCase extends Illuminate\Foundation\Testing\TestCase {
/**
* Creates the application.
*
* @return Symfony\Component\HttpKernel\HttpKernelInterface
*/
public function createApplication()
@gayanhewa
gayanhewa / sample
Created August 4, 2014 07:56
Spaces.
<?php
$status = 'Image successfully uploaded!';
?>
@gayanhewa
gayanhewa / wireless-reload.service
Created October 15, 2014 02:58
Reload wireless on resume - systemd
[Unit]
Description=Restart WiFi on Resume
After=suspend.target
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/modprobe -r rtl8821ae
ExecStart=/usr/bin/modprobe rtl8821ae
ExecStart=/usr/bin/ifconfig wlp3s0 down
@gayanhewa
gayanhewa / wifi-reconnect
Last active August 29, 2015 14:07
WIFI disconnection restart script - Realtek drivers
#!/bin/bash
# Unload kernel module , replace rtl8821ae with your device module.
modprobe -r rtl8821ae
#reload kernel module
modprobe rtl8821ae
# set wireless interface to down , replace wlp3s0 with your wifi device name
ip link set wlp3s0 down
#restart wpa_supplicant
systemctl reenable wpa_supplicant
@gayanhewa
gayanhewa / htaccess
Created November 2, 2014 17:08
Remove index.php from the url
Remove index.php from the url
http://stackoverflow.com/questions/10474740/how-to-remove-index-php-from-urls
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@gayanhewa
gayanhewa / server.block
Created November 18, 2014 09:22
Nginx Server Block
server {
listen 80;
root /vagrant/public;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from ...
server_name customer1.abc.com 192.168.22.10.xip.io vaprobash.dev;
access_log /var/log/nginx/vagrant.com-access.log;