Skip to content

Instantly share code, notes, and snippets.

View a1iraxa's full-sized avatar

Ali Raza a1iraxa

View GitHub Profile
@a1iraxa
a1iraxa / Component.jsx
Created March 29, 2020 16:57 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@a1iraxa
a1iraxa / macos_high_sierra_apache_php_brew_2018.md
Created March 28, 2020 19:14 — forked from karlhillx/macos_high_sierra_apache_php_brew_2018.md
macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

Homebrew Installation

First let's install Homebrew.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@a1iraxa
a1iraxa / rm_mysql.md
Created October 18, 2019 19:20 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@a1iraxa
a1iraxa / latest-and-first.php
Created May 23, 2019 10:36 — forked from gbyat/latest-and-first.php
get latest and first post in WordPress
/******************************************
* get latest post
* use in loop if ( is_latest() ) { stuff; }
******************************************/
function is_latest() {
global $post;
$loop = get_posts( 'numberposts=1' );
$latest = $loop[0]->ID;
return ( $post->ID == $latest ) ? true : false;
}
@a1iraxa
a1iraxa / all-actions-list.php
Created November 28, 2018 07:17 — forked from thefuxia/all-actions-list.php
Plugin All Actions List
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: All Actions List
Description: Lists all actions run during one request.
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
@a1iraxa
a1iraxa / ssh.txt
Created July 19, 2018 11:58 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets
# Login via SSH with password (LOCAL SERVER)
> ssh brad@192.168.1.29
# Create folder, file, install Apache (Just messing around)
mkdir test
cd test
touch hello.txt
sudo apt-get install apache2
# Generate Keys
@a1iraxa
a1iraxa / _notes.md
Created April 12, 2018 15:25 — forked from sgnl/_notes.md
AJAX with Vanilla Javascript. (XMLHttpRequest)

Short XHR Examples

Examples shown are bare minimum needed to achieve a simple goal.

Resources

  • Google Chrome's Dev Tools' Network Panel c-c-c-c-c-ULTIMATE c-c-c-COMBO!!!
  • requestb.in enpoints for your HTTP Requests as a free service.
@a1iraxa
a1iraxa / Date-Select-Markup.html
Created April 10, 2018 09:03 — forked from aleksblago/Date-Select-Markup.html
Markup: Select options for Month, Day, and Year.
<span>
<select name="month">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
@a1iraxa
a1iraxa / googlemap.html
Created April 4, 2018 09:04 — forked from brittanydionigi/googlemap.html
pin cities on a google map based on city name & country
<!doctype>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps - pin cities</title>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
#map_canvas { height: 100%; }
</style>
@a1iraxa
a1iraxa / woo-checkout-fields.php
Created March 2, 2018 13:12 — forked from bavington/woo-checkout-fields.php
Reorder Checkout Fields in WooCommerce
// Reorder Checkout Fields
add_filter('woocommerce_checkout_fields','reorder_woo_fields');
function reorder_woo_fields($fields) {
$fields2['billing']['billing_email'] = $fields['billing']['billing_email'];
$fields2['billing']['billing_first_name'] = $fields['billing']['billing_first_name'];
$fields2['billing']['billing_last_name'] = $fields['billing']['billing_last_name'];
$fields2['billing']['billing_country'] = $fields['billing']['billing_country'];
$fields2['billing']['billing_address_1'] = $fields['billing']['billing_address_1'];
$fields2['billing']['billing_address_2'] = $fields['billing']['billing_address_2'];