Skip to content

Instantly share code, notes, and snippets.

View gurindersingh's full-sized avatar

Gurinder Chauhan gurindersingh

View GitHub Profile
#!/bin/bash
export LDFLAGS=-Wl,-rpath=/var/task/lib/
export PKG_CONFIG_PATH='/canvas/lib/pkgconfig'
export LD_LIBRARY_PATH='/canvas/lib':$LD_LIBRARY_PATH
C_INCLUDE_PATH=/canvas/include/
CPLUS_INCLUDE_PATH=/canvas/include/
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
@gurindersingh
gurindersingh / php-get-remote-image-dimensions-curl
Created July 1, 2020 13:44 — forked from ontiuk/php-get-remote-image-dimensions-curl
Get Remote Image Dimensions With PHP and cURL - GetImageSize Alternative
<?php
/** 
* Retrieve remote image dimensions 
* - getimagesize alternative 
*/
/**
* Get Image Size 
@gurindersingh
gurindersingh / postgres-brew.md
Created May 4, 2020 20:52 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@gurindersingh
gurindersingh / postgres-brew.md
Created May 4, 2020 20:50 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX) (outdated see top most note)

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
@gurindersingh
gurindersingh / html
Created November 23, 2019 10:49
Countries Select Dropdown List
<select class="">
<option>Select Country...</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
// 1
$mock = \Mockery::mock(Newsletter::class);
$mock->shouldReceive('someMethod')->with('key', $value)->once();
app()->instance(Newsletter::class, $mock);
// 2
$this->instance(Newsletter::class, \Mockery::mock(Newsletter::class, function($mock) {
$mock->shouldReceive('someMethd')->with('key', 'value')->once();
@gurindersingh
gurindersingh / AuthServiceProvider.php
Created March 27, 2019 02:14 — forked from ralphschindler/AuthServiceProvider.php
Laravel 5.8 Policy Guesser For Using "Models" Directory
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**

PHP7.3 Available modules

Mudules Use
libapache2-mod-php7.3 server-side, HTML-embedded scripting language (Apache 2 module)
libphp7.3-embed HTML-embedded scripting language (Embedded SAPI library)
php7.3 server-side, HTML-embedded scripting language (metapackage)
php7.3-bcmath Bcmath module for PHP
php7.3-bz2 bzip2 module for PHP
php7.3-cgi server-side, HTML-embedded scripting language (CGI binary)
php7.3-cli command-line interpreter for the PHP scripting language
# Source From https://gist.github.com/jlong/2428561
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
Host github.com
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa