Skip to content

Instantly share code, notes, and snippets.

View ahait's full-sized avatar
🖥️
Working on pcrypt.com at the moment....

Raf ahait

🖥️
Working on pcrypt.com at the moment....
View GitHub Profile
@rasmuscnielsen
rasmuscnielsen / mamp-php-gmp.md
Last active May 22, 2024 12:20 — forked from wimarbueno/mamp-php-gmp.md
How to install GMP extension for PHP 7.4.2 using MAMP

Installing GMP extension for PHP 7.4 using MAMP

You have to build the GMP extension from the PHP source code. First install Autoconf and GMP using Homebrew.

brew install autoconf gmp

Download and unpack PHP.

@danrovito
danrovito / countrydropdown.html
Last active June 19, 2024 16:54
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@damianwajer
damianwajer / fix.css
Last active September 8, 2021 00:26
[CSS] Fix for font smoothing / antialiasing on Mac OS X (too heavy fonts)
.font-fix {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
@khlbrg
khlbrg / functions.php
Created February 20, 2014 12:02
Set another language in WPML
add_action('after_setup_theme', 'my_icl_set_current_language');
function my_icl_set_current_language($lang) {
global $sitepress;
$lang = 'sv';
$sitepress->switch_lang($lang);
}
@solepixel
solepixel / dynamic-pricing-table.php
Last active April 20, 2018 19:11
dynamic pricing table
<?php
function display_dynamic_pricing_table(){
global $post;
# see line 42 of woocommerce_pricing_by_product.class.php
$pricing_rule_sets = get_option('_a_category_pricing_rules', array());
$found = false;
if(count($pricing_rule_sets)){
global $woocommerce_pricing;
foreach ($pricing_rule_sets as $pricing_rule_set) {
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}