Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Rodriguez arod2634

View GitHub Profile
@arod2634
arod2634 / https.html
Created Oct 22, 2018
WordPress - WPE HTML Post Processing for Forced HTTPS URLs
View https.html
#https?://(www\.)?(http://domain.com|altdomainname.wpengine.com)/wp-(content|includes)# => https://domain.com/wp-$3
@arod2634
arod2634 / add-wp-admin.sql
Created Oct 22, 2018
WordPress - Add Admin User to DB via SQL
View add-wp-admin.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 Aug 29, 2015
Android 100 Exercise 1
View exercise-1-solution
<?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 Mar 1, 2015
Android Relative Layout Vertical Example
View 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 Aug 29, 2015
Android Relative Layout Example
View 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 Mar 1, 2015
Android Linear Layout Vertical Example
View linear-layout-vertical.xml
<?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 Mar 1, 2015
Android Linear Layout Example
View linear-layout.xml
<?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 / array-loops.m
Last active Aug 29, 2015
Looping though an NSMutableArray
View array-loops.m
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 Sep 30, 2012
Customize Wordpress Admin Toolbar
View custom-wp-toolbar.php
<?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(