start new:
tmux
start new with session name:
tmux new -s myname
| // jquery invert plugin | |
| // by paul irish | |
| // some (bad) code from this css color inverter | |
| // http://plugins.jquery.com/project/invert-color | |
| // some better code via Opera to inverse images via canvas | |
| // http://dev.opera.com/articles/view/html-5-canvas-the-basics/#insertingimages | |
| // and some imagesLoaded stuff from me | |
| // http://gist.github.com/268257 |
| // found here http://forums.shopify.com/categories/2/posts/29259 | |
| var getOrdinal = function(n) { | |
| var s=["th","st","nd","rd"], | |
| v=n%100; | |
| return n+(s[(v-20)%10]||s[v]||s[0]); | |
| } |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| /* Use WP-CLI instead https://developer.wordpress.org/cli/commands/search-replace/ */ | |
| SET @oldsite='http://oldsite.com'; | |
| SET @newsite='http://newsite.com'; | |
| UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite); | |
| UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite); | |
| /* only uncomment next line if you want all your current posts to post to RSS again as new */ |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
| #!/bin/bash | |
| DOMAIN=$1 | |
| KEYPATH="~/.ssh/servers/" | |
| # Check for already set-up configuration, if so, jsut connect | |
| echo ~/.ssh/servers/$DOMAIN | |
| if [ -f ~/.ssh/servers/$DOMAIN ]; | |
| then | |
| echo "Connecting you to $DOMAIN" |
| // Q sample by Jeff Cogswell | |
| /*=========== | |
| We want to call these three functions in sequence, one after the other: | |
| First we want to call one, which initiates an ajax call. Once that | |
| ajax call is complete, we want to call two. Once two's ajax call is | |
| complete, we want to call three. | |
| BUT, we don't want to just call our three functions in sequence, as this quick |