Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Http\Controllers;
use GuzzleHttp\Client;
class PostsAuthController extends Controller
{
//class variables
BEFORE you try to SSH into server type:
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa where id_rsa is the file with your ssh key (this is the default version so chances are yours is the same. If not, change it.
ssh root@xxx.xxx.xxx and hopefully no password required Needed them to log on. (From Tutorial https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh)
I used gitbash for this.
if (isset($options['event_host'])) {
$query->join('event_hosts', 'events.id', '=', 'event_hosts.event_id')
->orWhere(function ($q) use ($options, $query){
foreach ($options['event_host'] as $e){
$query = $q->where('event_hosts.host_name', 'LIKE', '%'.$e.'%');
}
});
}
$('#myModal1').hide()
$('body').removeClass('modal-open');
$('.modal-backdrop').remove();
$("div").removeClass("mfp-bg")
keywords.select2({
tags: true,
createTag: function (params) {
var term = $.trim(params.term);
var count = 0
var existsVar = false;
//check if there is any option already
if($('#keywords option').length > 0){
$('#keywords option').each(function(){
if ($(this).text().toUpperCase() == term.toUpperCase()) {
<?php
namespace App\Model;
use App\Http\Controllers\EventController;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Price;
<div class="row clearfix">
<h4 class="text-center">
@if($radius != 0 && $resultsCount == 0)
Zero Results Within {{$radius}} Km
@elseif((!empty($marketLocation) && $marketLocationMatchedCount == 0))
Not Available in {{$marketLocation}}
@elseif(!empty($marketLocation) && $marketLocationMatchedCount > 0)
Available in {{$marketLocation}}
@endif
</h4>
<?php
//Get current page form url e.g. &page=6
$currentPage = LengthAwarePaginator::resolveCurrentPage();
//Create a new Laravel collection from the array data
$collection = new Collection($data);
//Define how many items we want to be visible in each page
$perPage = 48;
// File Name GreetingClient.java
import java.net.*;
import java.util.Scanner;
import java.io.*;
public class Client
{
public static Socket sc;
public static void main(String [] args)
// File Name GreetingServer.java
import java.net.*;
import java.io.*;
public class Server
{
public static Socket socket;
public static void main(String[] args){