Skip to content

Instantly share code, notes, and snippets.

View dhakalsuresh's full-sized avatar
💭
I may be slow to respond.

Suresh Dhakal dhakalsuresh

💭
I may be slow to respond.
View GitHub Profile
@dhakalsuresh
dhakalsuresh / wp-contact-form-7
Last active August 22, 2022 04:46
Preview Method for contact form 7
<script>
jQuery(function($) {
// form preview
var validKey = {
"your-name": "Full Name",
"phone-number": "Phone Number",
"date-of-birth": "Date Of Birth",
"age" : "Age",
"gender" : "Gender",
"your-emai" : "Email",
$this->connectionMock->shouldReceive('table')->once()->andReturn($this->builderMock);
$this->builderMock->shouldReceive('join')->with('table_name AS sa', m::on(function ($join) {
$this->builderMock->shouldReceive('where')->andReturn($this->builderMock);
$query = $this->builderMock->shouldReceive('on')
->andReturn($this->builderMock)
->getMock();
$join($query);
return true;
}))->andReturn($this->builderMock);
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_queue_starter.sh":
mode: "000755"
owner: root
group: root
content: |
cd /var/www/html
php artisan queue:work 1>> /dev/null 2>&1 & echo queue2
#!/bin/bash
limit=2000
for i in {0..20}
do
offset=`expr $i \* $limit`
echo "/$offset/$limit"
done
@dhakalsuresh
dhakalsuresh / 00_nginx.config
Created February 13, 2019 05:14 — forked from 480/00_nginx.config
자주 쓰는 ebextensions 설정
# 장시간 http 연결로 인한 끊어짐을 방지키 위해 long idle time out 허용 하기
# nginx proxy 에 셋팅 + ELB 의 idle timeout 수정
#
# https://medium.com/tomincode/extending-gateway-timeouts-with-node-js-elastic-beanstalk-applications-5cb256f08f4b
# https://cloudavail.com/2015/10/18/allowing-long-idle-timeouts-when-using-aws-elasticbeanstalk-and-docker/
# https://github.com/metabase/metabase/tree/b9533d43881090a72d97562fb112a6133cd94127/bin/aws-eb-docker
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000644"