Skip to content

Instantly share code, notes, and snippets.

View ramiabraham's full-sized avatar

Rami Abraham ramiabraham

View GitHub Profile
@HarryUPf
HarryUPf / README.md
Last active September 28, 2023 01:37
Raspberry Pi SunVox Headless Synth (in 10 easy steps)

Raspberry Pi SunVox Headless Synth Setup (in 10-easy-steps)

INSTRUCTIONS

STEP_01

STEP_02

  • write the extracted .img to sdcard with Etcher

STEP_03

@jasoncoon
jasoncoon / FastLED-RGB-HSV-Tutorial.ino
Last active June 28, 2021 20:40
FastLED RGB & HSV Tutorial
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 8
// Data pin for the LEDs
#define DATA_PIN 17
// Potentiometer pins
#define POT_0_PIN A0
@sli
sli / MatricomManual.md
Last active July 3, 2021 22:22
Transcribed manual for Matricom GPad controllers.

Matricom Gamepad

For your enjoyment and safety, we recommend that you read this manual thoroughly before using this product and keep this manual handy for reference if needed.

Characteristics:

  1. Compatible with Android and PC
  2. Wireless
  3. D-Pad and 12 buttons
  4. Dual analog joysticks
@norcross
norcross / disable-username-login.php
Last active July 11, 2017 19:44
Force a redirect if a certain username is attempted.
<?php
add_filter( 'authenticate', 'rkv_disable_username_logins', 20, 3 );
/**
* Disable admin username and redirect to Google (or another site).
*
* @param object $user The WP_User object.
* @param string $username The entered username.
* @param string $password The entered password.
*
@ramiabraham
ramiabraham / affwp-wc-referral-by-product-type.php
Last active June 7, 2016 00:22
Adjusts the referral amount based on whether the product is virtual or not.
<?php
/**
* Plugin Name: AffiliateWP - Modify Referral If Virtual Product (WC)
* Plugin URI: https://affiliatewp.com
* Description: Modify referral rate
* Author: AffiliateWP Team
* Author URI: https://affiliatewp.com
* Version: 1.0
*/
function prefix_affwp_modify_referral_if_virtual( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) {
@robotnealan
robotnealan / sites-available-ghost
Last active March 20, 2019 09:33
DigitalOcean LetsEncrypt Nginx Config
server {
listen 80;
listen [::]:80;
server_name robertnealan.com;
root /var/www/ghost/system/nginx-root;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
<?php
class Beer {
const NAME = 'Beer!';
public static function printed(){
echo 'static Beer:NAME = '. static::NAME . '<br />';
}
}
class Ale extends Beer {
<?php
$filename = 'csvdata.csv';
header( 'Content-type: text/plain' );
if ( $data = fopen( $filename, 'r' ) ) {
// Snag the first row as column headers
$cols = fgetcsv( $data );
@JustinSainton
JustinSainton / notify.php
Created January 27, 2016 23:03
Use existing Gravity Forms notification on non-form data
<?php
$form_id = 12; // Or whatever form ID has the notificaiton you're after
$form = GFAPI::get_form( $form_id );
$notification = end( $form['notifications'] ); // Just an easy way to get the notification I wanted. YMMV.
$lead = array(
'id' => wp_generate_password( 64, true, true ), // Normally, this would be the Lead ID. Not necessary for us.
'form_id' => $form_id,
'source_url' => 'https://site.com/',
'status' => 'active',
'1.3' => $args['first_name'], // YMMV on these args - set them to whatever your form sets them to be.