Skip to content

Instantly share code, notes, and snippets.

View manutheblacker's full-sized avatar
🎯
Focusing

Emmanuel A. manutheblacker

🎯
Focusing
View GitHub Profile
@fjcaetano
fjcaetano / .gitignore-global
Created November 14, 2012 00:15
Global .gitignore file focused on PyCharm
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
@pwlin
pwlin / gist:4147863
Created November 26, 2012 12:02
google translate dropdown
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
@corsonr
corsonr / jquery.ui.datepicker-fr.js
Created December 16, 2012 10:53
jQuery UI datepicker in French
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '&#x3c;Préc',
nextText: 'Suiv&#x3e;',
currentText: 'Aujourd\'hui',
monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin',
'Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],
@denji
denji / nginx-tuning.md
Last active May 21, 2024 00:30
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.

@that0n3guy
that0n3guy / gist:905c812c0f65e7ffb5ec
Last active December 20, 2023 11:13
Mautic nginx config
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@bekarice
bekarice / filter-wc-orders-by-gateway.php
Last active August 3, 2023 13:37
Filters WooCommerce Orders by Payment Gateway Used
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
@darkoromanov
darkoromanov / freemius-2-fomo.php
Last active July 22, 2021 17:58
Freemius integration for Fomo
<?php
// Fomo documentation: https://docs.fomo.com/reference
// Freemius documentation: http://freemius.com/help/documentation/marketing-automation/events-webhooks/
// Install Fomo PHP SDK https://github.com/usefomo/fomo-php-sdk
include "vendor/autoload.php";
define("FOMO_AUTH_TOKEN", "*********");
@paaljoachim
paaljoachim / functions.php
Last active September 27, 2022 18:00
WooCommerce dropdown product quantity. It also correctly adds the correct minimum quantity when pressing the Add to Cart in the Shop page.
/** Initial code from: https://gist.github.com/kloon/6495019
As the code did not fully work I received help from Helga the Viking
with this gist: https://gist.github.com/helgatheviking/ff8792fbb12f5c5367c816b8a46c70ad
* Change the quantity input to select.
* @param array $args Args for the input.
* @param WC_Product|null $product Product.
* @param boolean $echo Whether to return or echo|string.
* @return string
*/
@tigerhawkvok
tigerhawkvok / poetry-convert.py
Last active May 6, 2024 06:18
Convert a requirements.txt file to a Poetry project
#!python3
"""
Convert a requirements.txt file to a Poetry project.
Just place in the root of your working directory and run!
"""
sourceFile = "./requirements.txt"
import re
import os
@andresabello
andresabello / SkeletonLoader.vue
Last active November 25, 2022 13:28
A skeleton loader for Vue JS. You will need to implement the setLoadingState. This one is just an example that hides the element after 5 seconds.
<template>
<div class="container">
<div class="row" v-show="loading">
<div class="col-xl-4 pt-5">
<div class="placeholder wave">
<div class="square"></div>
<div class="line"></div>
<div class="line"></div>
</div>
</div>