Skip to content

Instantly share code, notes, and snippets.

View apoorva-shah's full-sized avatar
😀

Apoorva Shah apoorva-shah

😀
View GitHub Profile
@apoorva-shah
apoorva-shah / cluster-page-close-test.js
Created January 1, 2020 12:53
puppeteer cluster page close issue
// Page should close after 2 mins but it is closed after ~27 seconds...
const { Cluster } = require('puppeteer-cluster');
(async () => {
const cluster = await Cluster.launch({
concurrency: Cluster.CONCURRENCY_CONTEXT,
maxConcurrency: 2,
puppeteerOptions: {
headless: false
}
@apoorva-shah
apoorva-shah / calendar.php
Last active July 14, 2018 06:58
php date time
<?php
$date = '2018-03-01';
$end = '2018-09-' . date('t', strtotime($date)); //get end date of month
?>
<table>
<tr>
<?php while(strtotime($date) <= strtotime($end)) {
$day_num = date('d', strtotime($date));
$day_name = date('l', strtotime($date));
$month = date('M', strtotime($date));
@apoorva-shah
apoorva-shah / example.html
Created June 23, 2018 06:42 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@apoorva-shah
apoorva-shah / footer.html.twig
Last active December 5, 2017 06:52
grayscale_new
@apoorva-shah
apoorva-shah / amazon-aws.txt
Last active November 4, 2017 18:48
amazon aws help
https://reddit.com/r/amazonwebservices
https://aws.amazon.com/blogs/aws/author/jbarr/
Amazon associate: Messaging, desktop and app streaming
security and identity
management tools
storage
databases
@apoorva-shah
apoorva-shah / htaccess-help.txt
Created October 26, 2017 05:46
Htaccess help
- Redirect to https and non-www to www
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&uact=8&ved=0ahUKEwjozKHqyo3XAhWENI8KHUSNAvoQFgg9MAQ&url=https%3A%2F%2Fsimonecarletti.com%2Fblog%2F2016%2F08%2Fredirect-domain-http-https-www-apache%2F&usg=AOvVaw3ZrAY62n_uaXWwa7g2eJs5
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
@apoorva-shah
apoorva-shah / symfony-help
Last active January 5, 2018 18:27
Symfony help
Command to see configuration:
php bin/console config:dump-reference sulu_product will help you to see list in yml file.
Article:
https://blog.martinhujer.cz/symfony-forms-with-request-objects/
@apoorva-shah
apoorva-shah / composer-help.txt
Last active November 8, 2017 16:46
Composer help
composer show --latest 'sonata-project/*'
"php": "^5.5.9 || ~7.0",