Skip to content

Instantly share code, notes, and snippets.

@mariolopjr
mariolopjr / updateGitAuthor.sh
Created March 21, 2015 20:43
Change Git Commit Author Info
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "OldName" ];
then
GIT_COMMITTER_NAME="NewName";
GIT_AUTHOR_NAME="NewName";
GIT_COMMITTER_EMAIL="NewEmail@site.com";
GIT_AUTHOR_EMAIL="NewEmail@site.com";
git commit-tree "$@";
else
git commit-tree "$@";
@mariolopjr
mariolopjr / tree.sh
Last active August 29, 2015 14:25
Alternative `tree`, suing only find and awk
#!/bin/bash
#
# Alternative to `tree`, lists directories/files in current directory
# Original credit to jweyrich from Stack Overflow: http://superuser.com/a/409654
# Edited by Mario Lopez
#
find $1 -print 2>/dev/null | awk '!/\.$/ { \
for (i=1; i<NF; i++) { \
@mariolopjr
mariolopjr / _form-filler.js
Last active November 3, 2015 16:38
Form Filler
//
// Form Filler
// Please remember to replace default values below with the actual username/password/db/etc.
// Based upon Chris Coyier's Implementation: https://css-tricks.com/prefilling-forms-custom-bookmarklet/
// Only supports Joomla! Installation form
// TODO: Figure a better way to have the script "wait" for Joomla! install
//
(function(win, doc, $) {
'use strict';
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mariolopjr
mariolopjr / autoscp.sh
Created November 18, 2015 00:39
Automate SCP
#!/usr/bin/expect -f
#
# Author: Mario Lopez
# Based upon: http://blogs.oracle.com/SanthoshK/entry/automate_linux_scp_command, modified for my own use
# Ex: autoscp "user@example.com:/source/dir/" "/target/dir" "PASSWORD"
#
# connect via scp
spawn scp $1 $2
@mariolopjr
mariolopjr / deleteTables.sql
Created November 18, 2015 15:05
Delete all tables in a database that match a specific prefix
/*
* Drop all tables with specific prefix
* Based on: http://stackoverflow.com/a/24668848
* Modified for my needs
*
*/
SET @database_name = 'database';
SET @table_prefix = 'prefix%';
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN = 100000;
@mariolopjr
mariolopjr / discard_JEvents_iCal_Import_Messages.php
Last active November 19, 2015 14:36
Discard JEvents iCal Import Events from Showing on Front End
<?php // This PHP opening tag can be discarded, only exists for syntax coloring :)
/*
*
* Author: Mario Lopez (iibits.com)
* License: MIT
*
* Instructions to implement will follow
*
*/
@mariolopjr
mariolopjr / post.sh
Last active January 3, 2016 17:49
Automates creating a new post with Octopress, just do "post Title of post" and the script will do the rest!
#!/bin/bash
#
# post.sh
#
# Originally created by:
# Hilton Lipschitz (http://www.hiltmon.com) @hiltmon
# Use and modify freely, attribution appreciated
#
# Create a new Octopress post, isolate it, generate the site and leave me with a
@mariolopjr
mariolopjr / publish.sh
Created January 18, 2014 23:25
Automates publishing Octopress content, just do "publish" and the script will do the rest!
#!/bin/bash
#
# publish.sh
#
# Mario Lopez (http://techsym.com) @cubanresourceful
# Use and modify freely, attribution appreciated
#
# Generates and deploys an Octopress instance for you.
#
@mariolopjr
mariolopjr / push.sh
Created January 22, 2014 00:14
Automates pushing the Octopress source, just do "push Commit message" and the script will do the rest!
#!/bin/bash
#
# push.sh
#
# Mario Lopez (http://techsym.com) @cubanresourceful
# Use and modify freely, attribution appreciated
#
# Generates and deploys an Octopress instance for you.
#