Skip to content

Instantly share code, notes, and snippets.

View arod2634's full-sized avatar

Alex Rodriguez arod2634

View GitHub Profile
@arod2634
arod2634 / https.html
Created October 22, 2018 13:31
WordPress - WPE HTML Post Processing for Forced HTTPS URLs
#https?://(www\.)?(http://domain.com|altdomainname.wpengine.com)/wp-(content|includes)# => https://domain.com/wp-$3
@arod2634
arod2634 / add-wp-admin.sql
Created October 22, 2018 13:29
WordPress - Add Admin User to DB via SQL
INSERT INTO `db_table_name`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('999999', 'alpinealex', MD5('password'), 'Alpine Alex', 'alex@alpinealex.com', 'https://alpinealex.com/', '1999-01-01 00:00:00', '', '0', 'Alpine Alex');
INSERT INTO `db_table_name`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999999', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `db_table_name`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999999', 'wp_user_level', '10');
@arod2634
arod2634 / exercise-1-solution
Last active August 29, 2015 14:16
Android 100 Exercise 1
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@arod2634
arod2634 / relative-layout-vertical-example
Created March 1, 2015 23:28
Android Relative Layout Vertical Example
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="150dp"
@arod2634
arod2634 / relative-layout-example
Last active August 29, 2015 14:16
Android Relative Layout Example
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@arod2634
arod2634 / linear-layout-vertical.xml
Created March 1, 2015 23:13
Android Linear Layout Vertical Example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight=".25"
@arod2634
arod2634 / linear-layout.xml
Created March 1, 2015 23:04
Android Linear Layout Example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="One"
@arod2634
arod2634 / Exercise-1---Using-jQuery.markdown
Created March 28, 2014 04:30
A Pen by Alex Rodriguez.
@arod2634
arod2634 / array-loops.m
Last active August 29, 2015 13:57
Looping though an NSMutableArray
NSMutableArray *myParty = [[NSMutableArray alloc] init];
[myParty addObject:@"Name: Alex's Awesome Party"];
[myParty addObject:@"Address: 123 Awesome Street"];
[myParty addObject:@"Date: May 17"];
// Manually output the value in each index
NSLog(@"%@",[myParty objectAtIndex:0]);
NSLog(@"%@",[myParty objectAtIndex:1]);
NSLog(@"%@",[myParty objectAtIndex:2]);
@arod2634
arod2634 / custom-wp-toolbar.php
Created September 30, 2012 01:41
Customize Wordpress Admin Toolbar
<?php
// Customize Admin toolbar if you do desiced to keep it around...
function change_toolbar($wp_toolbar) {
$wp_toolbar->remove_node('comments');
$wp_toolbar->add_node(array(
'id' => 'myhelp',
'title' => 'Help',
'meta' => array('target' => 'help')
));
$wp_toolbar->add_node(array(