Skip to content

Instantly share code, notes, and snippets.

View maravedi's full-sized avatar
🏒
Slappin' shots

maravedi

🏒
Slappin' shots
View GitHub Profile
@maravedi
maravedi / dev.bat
Last active August 29, 2015 14:12
Windows Batch File to Initialize Development Environment
rem I use this batch to make it easier to get going on my development.
rem Dump this script in your projects folder and then type 'dev myproject'
rem to start up an artisan serve on the myproject folder and to open up that
rem same folder in sublime.
rem Also, if you have mysql installed as a windows service and you will need that,
rem you can use the -m switch to fire up mysql (or -s to stop mysql).
rem This script is very basic, so there are probably many bugs in it.
@echo off
IF "%1"=="-s" goto STOPMYSQL
IF "%1"=="-m" goto START_MYSQL_1
@maravedi
maravedi / path_append
Last active August 29, 2015 14:12
Windows Append to Path Command Line
set PATH=%PATH%;C:\whatever\you\need\to\add
@maravedi
maravedi / homestead_32bit.md
Last active December 12, 2016 11:54
Setting up Homestead 2.0.7 on Windows 7 32-bit

#Introduction For the most part, you can follow the instructions given by Jeffrey Way at Laracasts - Say Hello to Laravel Homestead 2.

If you are like me and also have a 32-bit installation of Windows with low RAM, the there are a few exceptions.

#Setting up 32-bit Homestead Firstly, the default homestead VM is a 64-bit version of Ubuntu, so you'll need to change that. Thankfully, someone has created a 32-bit version of homestead already. To do this, you will need to go to C:\Users\myusername\AppData\Roaming\Composer\vendor\laravel\homestead\scripts\ and then edit the homestead.rb file.

Following the instructions from here, within the homestead.rb file you will need to change the line

@maravedi
maravedi / bluehost_mysqldump.md
Last active August 29, 2015 14:13
Copying your MySQL Database from Bluehost using SSH

I retrieved this information from Bluehost and from StackExchange.

#####1. First, SSH to your domain:

ssh bluehost_username@bluehost_domain.com

#####2. Next, execute this command:

mysqldump -p -u username database_name > dbname.sql

@maravedi
maravedi / wordpress_siteurl.md
Last active August 29, 2015 14:13
Changing Wordpress Siteurl through MySQL CLI

I retrieved this information from Wordpress.org and StackOverflow.

So, if you're like me, you started out with a Wordpress.com version of your blog. Then you moved to your own hosted WordPress installation. Now, you are ready to start messing with themes. So you have probably copied your WordPress files and your database over to your local machine. Now you're trying to log into the wp-admin page but you're being redirected to your live WordPress installation rather than your local one. You just need to change the siteurl in the local WordPress database. Here's what you do:

#####1. Login to your local MySQL.

mysql -u username -p

#####2. Use the WordPress Database.

@maravedi
maravedi / homestead_mysql_import.sh
Last active August 29, 2015 14:13
Shell Script for Importing MySQL into Homestead
#!/bin/bash
R='\e[0;31m' # Red
G='\e[0;32m' # Green
Y='\e[0;33m' # Yellow
C='\e[0m' # Text Reset
INFO="${Y}INFO${C}"
SUCCESS="${G}SUCCESS${C}"
ERROR="${R}ERROR${C}"
@ECHO OFF
rem ### Validation for second parameter - Must be numeric ###
SET "var="&FOR /f "delims=0123456789" %%i in ("%2") DO SET var=%%i
IF DEFINED var (
echo.
echo The second parameter must be numeric
echo.
goto:eof
)
# Keep the PowerShell window on top
$signature = @"
[DllImport("user32.dll")]
public static extern bool SetWindowPos(
IntPtr hWnd,
IntPtr hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
<# This is a powershell script to create dummy variables for SAS
The dataset used is the SASHELP.CARS data set, and this script
was used to follow along with the tutorial here:
http://support.sas.com/resources/papers/proceedings12/333-2012.pdf
#>
$d = @(
"All",
"Front"
)
#######################################################################
# File: GetEmployeeDetails.ps1
# Auth: David Frazer
# Date: 05/23/2016
# Purpose: Search AD for details based on DisplayName
#######################################################################
function PrintOutput {
# Return the employee details for a successfull query
Write-Host `n;