Skip to content

Instantly share code, notes, and snippets.

View faysalhaque's full-sized avatar
🎯
Focusing

Faysal Ul Haque faysalhaque

🎯
Focusing
View GitHub Profile
@piyushgarg-dev
piyushgarg-dev / README.md
Last active July 4, 2024 16:47
Kafka Crash Course
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active July 3, 2024 14:26
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@neilgee
neilgee / woo-endpoint-custom.php
Last active November 22, 2022 13:34
WooCommerce Endpoint Order and Rename - My Account Page v2.6+
<?php
/*
Plugin Name: WooCustom My Account
Plugin URI: http://wpbeaches.com/
Description: WooCustom - add a custom area in my-account
Author: Neil Gee
Version: 1.0.0
Author URI: http://wpbeaches.com
License: GPL-2.0+
@mcaskill
mcaskill / Function.Array-Group-By.php
Last active January 3, 2024 10:15
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@mhasan3
mhasan3 / shortcode.md
Created May 26, 2015 16:18
Adding shortcodes to visual composer.

Shortcodes in Visual Composer

For example you have your own shortcode "hello_name":

function hello($atts, $content) {

extract(shortcode_atts( array(

'salutation' => !empty($salutation) ? $salutation : 'Mr.', 
@james2doyle
james2doyle / simple-json-reponse.php
Last active March 7, 2024 06:02
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@shahril96
shahril96 / php_encoder.php
Created February 3, 2015 17:32
Simple PHP Obfuscator
// this was my attempt to write my own php obfuscator
// this was inspired by Carbylamine PHP Script Encoder
// its currently in alpha, because sometimes its work, and sometimes it doesnt
// this was written 3 years ago (ahh memories again)
// so code looks suck
// thanks to Mokhdzani Faeq for created good regexs
// have fun!
<?php
@greatghoul
greatghoul / manifest.json
Last active October 20, 2023 16:48
Chrome Extension Sample - detect if an extension is installed.
{
"name": "Detect if an extension installed",
"description": "Detect if an extension installed",
"version": "0.1",
"manifest_version": 2,
"permissions": [
"management"
],
"browser_action": {
"default_popup": "popup.html"
@hasinhayder
hasinhayder / envato-screenshots-downloader.php
Last active November 14, 2017 18:37
Download large preview images from the envato item's screenshots page
#!/usr/bin/env php
<?php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';
@tarex
tarex / gulpfile.js
Created October 14, 2014 23:34
My gulp file
var gulp = require('gulp'),
plug = require("gulp-load-plugins")({lazy:false})
wiredep = require('wiredep').stream;
gulp.task('bower', function () {
gulp.src('app/index.html')
.pipe(wiredep())
.pipe(gulp.dest('app/'));
});