Skip to content

Instantly share code, notes, and snippets.

View ankur13secret's full-sized avatar

ankur13secret

View GitHub Profile
@ankur13secret
ankur13secret / goLang.txt
Created January 6, 2016 10:12
Basic code example for GoLang
// Single line comment
/* Multi-
line comment */
// A package clause starts every source file.
// Main is a special name declaring an executable rather than a library.
package main
// Import declaration declares library packages referenced in this file.
import (
@ankur13secret
ankur13secret / pagination.blade.php
Created January 5, 2016 06:25
Laravel Custom Pagination View
//Try Using
@include('pagination.default', ['paginator' => $value])
//Use this way in your file to view
@if ($paginator->lastPage() > 1)
<ul class="pagination">
<li class="{{ ($paginator->currentPage() == 1) ? ' disabled' : '' }}">
<a href="{{ $paginator->url(1) }}">Previous</a>
</li>
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
@ankur13secret
ankur13secret / addBracketsInQuery5.txt
Created January 4, 2016 11:24
Adding Brackets in laravel 5 query
$customer = Customer::where(function($query) use ($param) {
$query->where('full_name', 'iLIKE', '%'.$param['keyword'].'%')
->orWhere('mobile', 'iLIKE', '%'.$param['keyword'].'%')
->orWhere('phone', 'iLIKE', '%'.$param['keyword'].'%');
})->where('published','1')
->where('customer_status','N')
->orderBy('full_name', 'ASC')->get();
@ankur13secret
ankur13secret / Bash.txt
Last active January 5, 2016 06:00
Learning Bash Scripting
Bash [Bourne Again Shell]
Bourne Means Boundary
It is named so, because it supports user interaction and again a user can only interact with the script if it will wait for user.
Bash supports two modes
1. Interactive Mode(waits for user command, if required) &,
2. Non-Interactive Mode
File Descriptors are basically used to give instructions from outer world, e.g keyboards
There are basically three types of file descriptors:-
@ankur13secret
ankur13secret / installMongoDB.sh
Last active July 14, 2018 02:43
To install MongoDB in a server
#!/usr/bin/env bash
echo "Written By Ankur Mishra"
echo "Starting Server Setup....."
echo "Be Sure you are are a super user..."
# To become a super user
sudo su
# to update the packages from repositories
apt-get update
@ankur13secret
ankur13secret / nginxServerScriptWithPgsql.sh
Last active January 5, 2016 06:02
To setup the nginx server with PgSQL database
#!/usr/bin/env bash
echo "Written By Ankur Mishra"
echo "Starting Server Setup....."
echo "Be Sure you are are a super user..."
# To become a super user
# to update the packages from repositories
apt-get update
@ankur13secret
ankur13secret / nginxServerScriptMysql.sh
Last active January 5, 2016 06:03
To Setup Nginx server on Ubuntu
#!/usr/bin/env bash
echo "Written By Ankur Mishra"
echo "Starting Server Setup....."
echo "Be Sure you are are a super user..."
# To become a super user
sudo su -i
# to update the packages from repositories
apt-get update