Skip to content

Instantly share code, notes, and snippets.

View faysalhaque's full-sized avatar
🎯
Focusing

Faysal Ul Haque faysalhaque

🎯
Focusing
View GitHub Profile
@tarex
tarex / functions.php
Last active August 29, 2015 14:05
Add custom log into WordPress
<?php
if(!function_exists('_log')){
function _log( $message ) {
if( WP_DEBUG === true ){
if( is_array( $message ) || is_object( $message ) ){
error_log( print_r( $message, true ) );
} else {
error_log( $message );
}
@mclanecreative
mclanecreative / my-account.php
Last active March 27, 2023 23:12
Adds Tabs to WooCommerce "My Account" page. Instructions: add my-account.php to your /woocommerce/myaccount/ folder. Next, add the CSS to your child theme's style.css file. 11/25/2015 - Added tab6 for Event Espresso WP User Integration. Next challenge is to include Sensei My Courses & Pippin's AffiliateWP on these tabs.
<?php
/**
* My Account page
*
* @author WooThemes
* @edited by McLane Creative
* @package WooCommerce/Templates
* @version 3.1.0
*/
@weberste
weberste / gist:354a3f0a9ea58e0ea0de
Last active February 23, 2025 19:18
Dates only with Angular-UI Bootstrap datepicker
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
(function ($) {
/**
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
*/
@dylants
dylants / upload-data-controller.js
Created September 19, 2013 00:50
Upload CSV (Excel spreadsheet) data to a listening Node.js controller.
var request = require("request"),
csv = require("csv");
module.exports = function(app) {
// accepts the POST form submit of the CSV file
app.post("/upload/data", function(req, res) {
// the name under "files" must correspond to the name of the
// file input field in the submitted form (here: "csvdata")
csv().from.path(req.files.csvdata.path, {
delimiter: ",",
@lucasstark
lucasstark / gist:6594983
Created September 17, 2013 14:21
Example to add meta data to woocommerce cart items
<?php
/*
* Plugin Name: Example Modify Price
*/
class Example_Modify_Price {
private static $instance;
public static function register() {
if (self::$instance == null) {
@pento
pento / commercial-client.php
Created July 2, 2013 12:29
Sample Commercial Plugin update server and client
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 22, 2025 08:10
A badass list of frontend development resources I collected over time.
@claudiosanches
claudiosanches / functions.php
Last active June 22, 2018 16:57
WooCommerce: Validate cart quantity.
<?php
/**
* Validate product quantity when added to cart.
*/
function cs_add_to_cart_validate_quantity( $valid, $product_id, $quantity ) {
global $woocommerce;
$valid = true;
// Test quantity.
@anchetaWern
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users