Skip to content

Instantly share code, notes, and snippets.

View Dipenduroy's full-sized avatar
🏠
Working from home

Dipendu Roy Dipenduroy

🏠
Working from home
  • IBM
  • Ahmedabad
View GitHub Profile

ServiceNow - Jelly scripting cheatsheet

UI Page consists of jelly, client script and processing script. UI Macro has the jelly script only (but client script can be injected in jelly script) Usages:

  • Open as a page using URI https://<instance_name>.service-now/<ui_page_name>.do
  • Open as a modal using client script (UI action, client script, etc) (see snippet 1)
// Snippet 1
var gm = new GlideModal('UI_dialog_name');
gm.setTitle('Show title');
@Dipenduroy
Dipenduroy / mac-setup-redis.md
Created July 3, 2020 14:08 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@Dipenduroy
Dipenduroy / ZipkinService.php
Created June 2, 2020 13:55
Guzzle Zipkin Trace Lumen Sample code - Middleware is used to flush trace at the end of script
<?php
namespace App\Services\Trace;
use Zipkin\Propagation\DefaultSamplingFlags;
use Zipkin\Propagation\Map;
use Zipkin\Timestamp;
use Zipkin\Endpoint;
use Zipkin\Samplers\BinarySampler;
use Zipkin\TracingBuilder;
@Dipenduroy
Dipenduroy / docker-php-ext-install.md
Created May 27, 2020 11:46 — forked from giansalex/docker-php-ext-install.md
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@Dipenduroy
Dipenduroy / laravel-on-shared-hosting-htaccess.md
Created April 25, 2020 07:00 — forked from bladeSk/laravel-on-shared-hosting-htaccess.md
Deploying Laravel on a shared hosting using only .htaccess

Deploying Laravel on a shared hosting using only .htaccess

Making Laravel work on a shared hosting can be troublesome, because Laravel needs to have its document root set to the public directory. This may not be configurable by a user or even desirable, when the server is hosting multiple websites.

Here's a simple method using only a .htaccess file placed in Laravel's root directory - e.g. alongside app, bootstrap, config, ... No changes whatsoever are necessary to your code.

The file rewrites all the requests so that requesting /file.png would in fact return /public/file.png and anything else is routed to /public/index.php. This also ensures that nothing outside the public folder can be accessed, thereby protecting any sensitive files like .env or database/*.

The simple method

@Dipenduroy
Dipenduroy / .htaccess
Created April 18, 2020 10:29 — forked from leocaseiro/.htaccess
Angular html5Mode apache working in a subdirectory /app using ngRoute
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /app/index.html [NC,L]
</IfModule>
@Dipenduroy
Dipenduroy / example.php
Created February 25, 2020 09:47 — forked from ralphschindler/example.php
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';