Skip to content

Instantly share code, notes, and snippets.

View ramiabraham's full-sized avatar

Rami Abraham ramiabraham

View GitHub Profile
<?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.
@helen
helen / better-wp.php
Last active December 16, 2016 18:29
Make WordPress Great Again
<?php
// Inspired by http://jsfiddle.net/desandro/Ew6Zt/
add_action( 'admin_head', function(){
?>
<script>
jQuery(document).ready( function($) {
var colorTime = 0,
waveTheta = 0,
maxCount = 100,
@beriberikix
beriberikix / apa102_raindbow_attiny85.ino
Created December 7, 2015 22:21
Demo using Pololu's APA102 library with an ATTiny85 @ 16 MHz.
/* This is a fork of the Raindbow sample from
* https://github.com/pololu/apa102-arduino/blob/master/examples/Rainbow/Rainbow.ino
* to work on an ATTiny85 @ 16MHz. While there is no license in the file, the overall
* library appears to be under MIT:
* https://github.com/pololu/apa102-arduino/blob/master/LICENSE.txt
*/
#include <avr/power.h>
#include <APA102.h>
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active June 25, 2025 08:34 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@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

@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

@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
@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.