Skip to content

Instantly share code, notes, and snippets.

View michelve's full-sized avatar
🌏
Rise and Reign

Michel michelve

🌏
Rise and Reign
View GitHub Profile
@Hailong
Hailong / Index.php
Last active November 25, 2020 01:23
Fix ShipStation plugin for Magento 2.3
<?php
namespace Auctane\Api\Controller\Auctane;
use Exception;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\App\RequestInterface;
class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
{
@michelve
michelve / wp-odd-even-post.php
Last active June 18, 2018 14:22
create odd and even layout for wp post loop
<?php
$args = array(
'posts_per_page' => 5,
'offset' => 0,
'category' => '',
'category_name' => '',
'orderby' => 'date',
'order' => 'DESC',
'include' => '',
@claudiosanches
claudiosanches / custom-my-account-endpoint.php
Last active April 30, 2024 03:05
Example of custom My Account endpoint.
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
@carlodaniele
carlodaniele / food-example-plugin.php
Last active August 22, 2021 09:00
An example plugin for WPMU DEV readers
<?php
/**
* @package Food_example_plugin
* @version 1.0
*/
/*
Plugin Name: Food example plugin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for WPMU DEV readers
Author: Carlo Daniele
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@rtrouton
rtrouton / gist:f92f263414aaeb946e54
Last active May 30, 2021 12:32
Install Xcode command line tools on 10.7.x - 10.10.x. Tested on 10.7.5, 10.8.5, 10.9.5 and 10.10.2.
#!/bin/bash
# Installing the Xcode command line tools on 10.7.x or higher
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
# Installing the latest Xcode command line tools on 10.9.x or higher
if [[ "$osx_vers" -ge 9 ]]; then
@tegansnyder
tegansnyder / find-products-without-images.sql
Created January 16, 2014 21:58
Magento - finding products without images. Raw SQL.
SELECT *
FROM `catalog_product_entity` AS a
LEFT JOIN `catalog_product_entity_media_gallery` AS b ON a.entity_id = b.entity_id
WHERE b.value IS NULL
@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@meyertee
meyertee / css-nthchildn.js
Created November 2, 2011 10:17
Modernizr Test 'nthchildn'
// Test for nth-child(...n) support
Modernizr.testStyles(" #modernizr div:nth-child(3n){width:10px;} ", function(elem, rule){
var bool = false, divs = elem.getElementsByTagName("div");
if (divs.length == 7){
var test = window.getComputedStyle ? function(i){
return getComputedStyle(divs[i], null)["width"] == "10px";
} : function(i){
return divs[i].currentStyle["width"] == "10px";
};
bool = !test(0) && !test(1) && test(2) && !test(3) && !test(4) && test(5) && !test(6);