Skip to content

Instantly share code, notes, and snippets.

View AdelDima's full-sized avatar
:octocat:
Working from home

Adel Tahri AdelDima

:octocat:
Working from home
View GitHub Profile
@alexanderytaylor
alexanderytaylor / pixel.js
Created March 27, 2024 21:16
shopify-posthog-custom-web-pixel
const postHogApiKey = "POSTHOG_API_KEY";
const postHogEndpoint = "https://app.posthog.com/capture";
const headers = {
"Content-Type": "application/json",
};
// Customer information
const customer = init.data.customer;
const { id, email, firstName, lastName } = customer;
const fullName = `${firstName} ${lastName}`;
@ShinyObjectLabs
ShinyObjectLabs / BaseForm.tsx
Last active August 1, 2024 18:09
Framer Form Component
/*
MIT License
Copyright © Joel Whitaker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@byk0t
byk0t / docker-compose.yml
Last active January 26, 2024 16:08
Docker compose for odoo:14 and PostgreSQL:13
version: '3'
services:
db:
image: postgres:13
volumes:
- db-data:/var/lib/postgresql/data/pgdata
ports:
- 5432:5432/tcp
environment:
- POSTGRES_PASSWORD=odoo
@thanhluu
thanhluu / checkbase.php
Last active October 26, 2017 11:53
Ignore folder for theme check
// Search "$dir_iterator" then insert those codes below this line:
// $dir_iterator = new RecursiveDirectoryIterator( $dir );
$filter = array( 'framework', 'tools', 'vendor', 'lib', 'installer', 'updater' );
$dir_iterator = new \RecursiveCallbackFilterIterator(
$dir_iterator,
function( $item ) use ( $filter ) {
return ! in_array( $item->getBaseName(), $filter );
}
);
@westonruter
westonruter / site-title-smilies.php
Last active August 30, 2024 08:43
Selective refresh example plugin
<?php
/**
* Plugin name: Site Title (and Tagline) Smilies
* Description: Demonstration of selective refresh in the Customizer. Selectors are targeting elements in Twenty Fifteen.
* Author: Weston Ruter, XWP
* Plugin URL: https://gist.github.com/westonruter/a15b99bdd07e6f4aae7a
*
* @package SiteTitleSmilies
*/
@mo3aser
mo3aser / Removing the automatic <p> and <br> WordPress-Shortcodes.php
Last active December 18, 2015 13:18
Removing the automatic <p> and <br> WordPress Shortcodes.
<?php
// Removing the automatic <p> and <br> WordPress Shortcodes
// By Fouad Badawy | tielabs.com
function tie_fix_shortcodes($content){
$array = array (
'[raw]' => '',
'[/raw]' => '',
'<p>[raw]' => '',
'[/raw]</p>' => '',
<?php
/**
* Escape all translations with
*/
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );.
/**
* When there is no HTML use:
*/
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 2, 2024 05:46
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten