Skip to content

Instantly share code, notes, and snippets.

View AJ-Acevedo's full-sized avatar
🤓
Studying

AJ Acevedo AJ-Acevedo

🤓
Studying
View GitHub Profile
@AJ-Acevedo
AJ-Acevedo / option.php
Last active December 24, 2015 01:19
Simple Solution to run a Development WordPress installation with the same database and codebase as the production server.
// Substitute URL for local/dev deploys
if ($option == "siteurl" || $option == "home") {
if ( strcmp($_SERVER['HTTP_HOST'], 'http://localhost') != 0)
return "http://$_SERVER[HTTP_HOST]";
}
@AJ-Acevedo
AJ-Acevedo / .gitignore
Created October 6, 2013 22:11
Example .gitignore file for WordPress with customized plugins, and files to include in the root directory.
# Ignore everything
*
# Ignore everything except
!.gitignore
!.htaccess
!Gruntfile.js
!/lists/
!/lists/*
!/lists/*/*
@AJ-Acevedo
AJ-Acevedo / this_should_work.css
Last active December 25, 2015 10:59
For Jillaone
/* Comment the current #thank-you-for-subscribing class and add this */
#thank-you-for-subscribing {
font-size: 60px;
min-height: 100%;
min-width: 1024px;
width: 100%;
/*width: auto; */
height: auto;
position: fixed;
@AJ-Acevedo
AJ-Acevedo / csp-db.sql
Last active December 28, 2015 20:19
Convert the CSP database
UPDATE flightlu_posts SET guid = replace(guid, 'http://csp.ajacommerce.com', 'http://localhost');
UPDATE flightlu_posts SET post_content = replace(post_content, 'http://csp.ajacommerce.com', 'http://localhost');
UPDATE flightlu_postmeta SET meta_value = replace(meta_value,'http://csp.ajacommerce.com', 'http://localhost');
UPDATE flightlu_options SET option_value = replace(option_value, 'http://csp.ajacommerce.com', 'http://localhost') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'dashboard_widget_options';
@AJ-Acevedo
AJ-Acevedo / bs_contact.html
Created January 12, 2014 19:04
Bootstrap 3 Contact Form
<form role="form">
<div class="form-group">
<label for="contactForm">Contact Us</label>
</div>
<!-- TODO: Move styles into style.css -->
<div class="form-group">
<input type="text" class="form-control" style="width:233px" placeholder="Your First Name">
</div>
<div class="form-group">
<input type="text" class="form-control" id="lastInput" style="width:233px" placeholder="Your Last Name">
@AJ-Acevedo
AJ-Acevedo / myIP.sh
Created January 19, 2016 04:50
myIP - Show both the Public and Private IP Addresses on a Mac or Debian Linux system
#!/usr/bin/env bash
#
# myIP
# Description: Show both the Public and Private IP Addresses on a Mac or Debian Linux system.
# Usage: Drop this file in ~/bin, add ~/bin to your $PATH and just type myIP on the CLI. That's it!
#
# URL: AJAlabs.com
# Author: AJ Acevedo
# Copyright (c) 2016 AJ Acevedo
# License: MIT - https://opensource.org/licenses/MIT
@AJ-Acevedo
AJ-Acevedo / UpdateDescription.ps1
Last active January 22, 2016 21:22
Update the Description of a Windows Computer with PowerShell
# Update-Description
# Description: Update the Computer Description of a Windows Computer with PowerShell. The description is updated in both Active Direcotry and on the PC.
# Usage: UpdateDescription -computername 420XX-XXXX -description "First Last Desktop"
#
# URL: AJAlabs.com
# Author: AJ Acevedo
# Copyright (c) 2016 AJ Acevedo
# License: MIT - https://opensource.org/licenses/MIT
#
# Version: v0.4
@AJ-Acevedo
AJ-Acevedo / sheep.js
Last active June 9, 2016 17:51
Code School - Javascript Roadtrip Part 2 - Level 2 Challenges 7
var numSheep = 4;
var monthsToPrint = 12;
for(var monthNumber = 1; monthNumber <= monthsToPrint; monthNumber++) {
if ( monthNumber % 4 == 0 ) {
numSheep /= 4;
console.log("Removing " + (numSheep * 3) + " sheep from the population. Phew!");
}
else if ( numSheep > 10000 ) {
# app / controllers / application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters