Skip to content

Instantly share code, notes, and snippets.

View geminorum's full-sized avatar
🏠
Working from home

Nasser Rafie geminorum

🏠
Working from home
View GitHub Profile
@kylekatarnls
kylekatarnls / roadmap.md
Last active March 8, 2019 13:13
Carbon 2 proposal

Carbon 2 (Draft)

Complete set of PHP Date classes extensions:

class extends comment
Carbon DateTime
CarbonImmutable DateTimeImmutable new
CarbonInterface DateTimeInterface new
CarbonTimeZone DateTimeZone new

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@treehousetim
treehousetim / TextTable.php
Last active April 18, 2019 21:04 — forked from dapepe/TextTable.php
Class to generate a Markdown-style table from a PHP array
<?php
//https://gist.github.com/dapepe/9956717
/**
* Creates a markdown document based on the parsed documentation
*
* @author Peter-Christoph Haider <[email protected]>
* @package Apidoc
* @version 1.00 (2014-04-04)
* @license GNU Lesser Public License
*/
@Mte90
Mte90 / snippet.php
Last active February 24, 2021 18:25
Custom WordPress Error Handler. Support Query Monitor and can be used as mu-plugin.
<?php
/*
* Plugin Name: Better errors
* Description: Better errors in log
* Author: Daniele Scasciafratte
* Version: 1.0
* Author URI: http://codeat.co
*/
function handleError($code, $description, $file = null, $line = null, $context = null) {
@mhf-ir
mhf-ir / sheba.js
Created November 24, 2017 09:48
iranian sheba bank validation javascript | اعتبار سنجی کد شبا با جاوا اسکریپت
function iso7064Mod97_10(iban) {
var remainder = iban,
block;
while (remainder.length > 2){
block = remainder.slice(0, 9);
remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);
}
return parseInt(remainder, 10) % 97;
@yairEO
yairEO / events.namespace.js
Last active August 11, 2023 07:08
Event Handler Namespace in Vanilla JavaScript
var events = (function(){
function addRemove(op, events, cb){
if( cb )
events.split(' ').forEach(name => {
var ev = name.split('.')[0]
cb = cb || this._eventsNS[name]
this[op + 'EventListener'].call(this, ev, cb)
if(op == 'add')
@ebraminio
ebraminio / persian-braille.json
Last active November 14, 2018 09:54
Persian Braille
{
"آ": "⠜",
"ا": "⠁",
"ب": "⠃",
"پ": "⠏",
"ت": "⠞",
"ث": "⠹",
"ج": "⠚",
"ﭺ": "⠉",
"ح": "⠱",
<?php if ( $latest_version && apply_filters( 'document_revisions_enable_webdav', true ) ) { ?>
<object id="winFirefoxPlugin" type="application/x-sharepoint" width="0" height="0" style="visibility: hidden;"></object>
<a id="edit-desktop-button" href="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" class="button" title="<?php esc_attr_e( 'Edit on Desktop', 'wp-document-revisions' ); ?>">
<?php esc_html_e( 'Edit on Desktop', 'wp-document-revisions' ); ?>
</a>
<?php } // End if(). %>
@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
*
@markjaquith
markjaquith / suicidal-filter.php
Last active October 22, 2023 23:14
Version of `add_filter()` for WordPress that only runs once
<?php
/*
Use this just like `add_filter()`, and then run something that calls the filter (like
`new WP_Query`, maybe).
That's it. If the filter gets called again, your callback will not be.
This works around the common "filter sandwich" pattern where you have to remember to
call `remove_filter` again after your call.