Skip to content

Instantly share code, notes, and snippets.

View ramiabraham's full-sized avatar

Rami Abraham ramiabraham

View GitHub Profile
@amdrew
amdrew / edd.php
Last active August 29, 2015 14:07
AffiliateWP - Disable referrals on specific product categories in WooCommerce or Easy Digital Downloads
<?php
/**
* Disable referrals on specific product categories in Easy Digital Downloads
*/
function affwp_custom_edd_disable_referrals_on_categories( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) {
// Array of categories to disable referrals for. Separate by a comma and use either the term name, term_id, or slug
$disabled_categories = array( 'category-one', 5 );
@RandomInsano
RandomInsano / Alphie.rst
Last active October 17, 2023 19:22
Edwin's notes from hacking a Playskool Alphie Robot

Alphie (2009) Hacking Notes

Note: I no longer have cards and didn't scan them. You're best bet is eBay, though it's quite expensive.

I want to make my own booster packs for Alphie, a children's learning toy, so I'm learning how he works internally so I can see if it's possible. It may be helpful for someone else down the line, but for right now it's just a lot of fun. Even if I don't get there, it's great practice of both documentation (which I'm terrible at writing) and reverse engineering.

I2C Pinout

@johnbillion
johnbillion / gist:4fa3c4228a8bb53cc71d
Last active February 18, 2025 13:06
WordPress Flow
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@brpowell
brpowell / romsync.py
Last active March 28, 2023 23:40
Dropbox ROM syncing
# - write token and cursor to .romsync
# * update cursor every delta check
# * config file format
# token=token_string
# cursor=cursor_string
# db_roms=path_to_dropbox_roms
# local_roms=path_to_local_roms
# * upload new config to dropbox
import os

On Lockpicking

Carrying picking tools is not against the law but context matters (being behind the home depot at 2 am)

Do not pick locks you do not own Do not pick locks which you rely on (bc you can break them)

Pin tumbler locks goes back 4500 yrs

Lockcon

@mariusvetrici
mariusvetrici / Filter Custom Posts by Author in WP-ADmin.php
Last active February 1, 2024 05:37
Need to filter your Custom Post Types (WordPress) by Author in WPAdmin? Here's a handy way to do it by adding a new drop down for filtering
<?php
add_action( 'restrict_manage_posts', 'admin_posts_filter_restrict_manage_posts_by_author' );
/**
* Create the drop down
*
* @return void
*/
function admin_posts_filter_restrict_manage_posts_by_author(){
if (isset($_GET['post_type']) && 'task' == $_GET['post_type']){
wp_dropdown_users( array(
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active August 2, 2025 18:35
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@JayWood
JayWood / fix_msword.php
Last active August 29, 2015 14:25
Fixes MS Word data
/**
* fixMSWord
*
* Replace ascii chars with utf8. Note there are ascii characters that don't
* correctly map and will be replaced by spaces.
*
* Updated 7-15-2015 by Jay Wood to encode lower end items into HTML entity counterparts.
*
* @author Robin Cafolla,Jay Wood
* @date 2013-03-22
@ramiabraham
ramiabraham / cornbread.md
Last active September 15, 2016 16:34
buttermilk cornbread recipe

buttermilk cornbread

this is really good and you should make it

  • servings: 30
  • prep: 15 mins
  • cook time: 40 mins
  • ready in: 55 mins

ingredients

@ramiabraham
ramiabraham / parbs-scale.md
Last active March 13, 2018 16:32
The Parbs Scale

The Parbs Scale: a Unit of Measurement for the Modern World


A Practical Means of Measuring Human-scale Physical Objects

Author: Rami Abraham
August 30, 2015

Abstract