Skip to content

Instantly share code, notes, and snippets.

View burntblark's full-sized avatar

Familusi Babatunde burntblark

View GitHub Profile
@tnog
tnog / customer_registration_email_alert.php
Created March 30, 2017 05:08
WooCommerce: Send a custom admin email when a new customer creates a new account.
<?php
namespace Your\Custom\Namespace;
/**
* Send a custom admin email when a new customer creates a new account.
* @param integer $user_id The ID of the user whose data should be retrieved.
* @return [type] [description]
*/
function customer_registration_email_alert( $user_id ) {
@sgress454
sgress454 / custom-blueprint.md
Last active March 5, 2022 06:05
Adding a custom blueprint action to all models

Reference: https://gitter.im/balderdashy/sails?at=58be4b1af1a33b62758d57ea

Is there anyway that I can add a method to all routes?

The issue

Given a Sails app with two models User and Pet, how do we create a single controller action foo and have it automatically run on requests for both /user/foo and /pet/foo?

The solution

@jarrad
jarrad / install-kafka.txt
Last active August 16, 2024 05:08
Install Kafka on OSX via Homebrew
$> brew cask install java
$> brew install kafka
$> vim ~/bin/kafka
# ~/bin/kafka
#!/bin/bash
zkServer start
kafka-server-start.sh /usr/local/etc/kafka/server.properties
@hrules6872
hrules6872 / SpaceItemDecoration.java
Last active April 25, 2020 12:04
Space ItemDecoration for RecyclerView
public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
private static final boolean DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM = false;
private static final boolean DEFAULT_ADD_SPACE_BELOW_LAST_ITEM = false;
private final int space;
private final boolean addSpaceAboveFirstItem;
private final boolean addSpaceBelowLastItem;
public SpaceItemDecoration(int space) {
this(space, DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM, DEFAULT_ADD_SPACE_BELOW_LAST_ITEM);
@dmglab
dmglab / git_bible.md
Last active March 9, 2024 02:59
how to git

Note: this is a summary of different git workflows putting together to a small git bible. references are in between the text


How to Branch

try to keep your hacking out of the master and create feature branches. the [feature-branch workflow][4] is a good median between noobs (i have no idea how to branch) and git veterans (let's do some rocket sience with git branches!). everybody get the idea!

Basic usage examples