Skip to content

Instantly share code, notes, and snippets.

View zackn9ne's full-sized avatar

zackn9ne zackn9ne

  • earth, New York
View GitHub Profile
@zackn9ne
zackn9ne / gist:5445399
Last active December 16, 2015 13:59
Switch WordPress
UPDATE wp_options SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
With these you can just copy paste the 'http://www.olddomain.com', 'http://www.newdomain.com'); and append it to the end
---v-------v-------^------v-------v-------^---v-------v-------^------v-------v-------^---v-------v-------^------v-------v-------^
UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com','http://www.newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com', 'http://www.newdomain.com');
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="7" bash
@zackn9ne
zackn9ne / gist:7827310
Created December 6, 2013 16:09
UNIX: ssh authorized keys
Step 1: Check for SSH keys
cd ~/.ssh ls
Step 2: Generate a new SSH key
ssh-keygen -t rsa -C "[email protected]"
Step 3: Step 3: Add your SSH key to authorized keys file
cat your public_key to this file ~/.ssh/authorized_keys"
@zackn9ne
zackn9ne / gist:7864789
Created December 8, 2013 22:44
UNIX: download podcast
wget -q -O- http://feed.podcast.ubuntu-uk.org/ogg/ | grep -o "<enclosure[ -~][^>]*" | grep -o "http://[ -~][^\"]*" | xargs wget -c
@zackn9ne
zackn9ne / gist:7873636
Created December 9, 2013 15:08
UNIX: ls wildcard non-recursive
ls with wildcard without recursive
ls -lhd f*
@zackn9ne
zackn9ne / gist:7998648
Created December 17, 2013 01:54
Smooth Scroll with Offset
$('.scrollto').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var hashStr = this.hash.slice(1);
var target = $(this.hash);
target = target.length ? target : $('[name=' + hashStr +']');
if (target.length) {
$('html,body').animate({ scrollTop: target.offset().top - 20}, 500);
window.location.hash = hashStr;
@zackn9ne
zackn9ne / gist:8059811
Created December 20, 2013 19:10
510px eBlast *urban outfitters*
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Amazing last-minute gift ideas for her…</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="title" content="Amazing last-minute gift ideas for her…">
<meta name="description" content="Last-Minute Gifts: Shop For Her">
<style media="all" type="text/css">
table img {
display:block;
}
</style></head><body onload='' style="background-color: #ffffff; font-size: 10px; color: gray; font-family: Verdana, Arial, San-Serif, Geneva;">
@zackn9ne
zackn9ne / gist:8938773
Last active August 29, 2015 13:56
foundation global slider config
<script type="text/javascript">
$(document).foundation('orbit', {
animation: 'fade', // fade, horizontal-slide, vertical-slide, horizontal-push
animationSpeed: 800, // how fast animtions are
timer: false, // true or false to have the timer
advanceSpeed: 4, // if timer is enabled, time between transitions
pauseOnHover: false, // if you hover pauses the slider
startClockOnMouseOut: false, // if clock should start on MouseOut
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
directionalNav: true, // manual advancing directional navs
@zackn9ne
zackn9ne / basic-sinatra.rb
Created May 1, 2014 13:20
basic sinatra route
require 'sinatra'¬
require 'sinatra/reloader'¬
¬
#routes¬
get '/' do¬
erb :index¬
⋅⋅¬
end¬
@zackn9ne
zackn9ne / name_route.rb
Last active August 29, 2015 14:00
/name route with instance variable
get '/name' do
@name = params[:user_name]
erb :name
end