Skip to content

Instantly share code, notes, and snippets.

View vivianspencer's full-sized avatar

Vivian Spencer vivianspencer

View GitHub Profile

Setup new Mac with OSX Lion from scratch

These commands are good as of 2011-07-27.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

@vivianspencer
vivianspencer / gist:77fb9f39656f3ec4934d
Created May 29, 2014 08:10
Access MySQL Server Remotely Over SSH
ssh -L 3306:localhost:3306 username@host
@vivianspencer
vivianspencer / file_mods.sh
Last active May 15, 2018 01:02
Recursively chmod only files
find . -type f -exec chmod 644 {} \;
@vivianspencer
vivianspencer / directory_mods.sh
Last active August 29, 2015 14:01
Recursively chmod only directories
find . -type d -exec chmod 755 {} \;
@vivianspencer
vivianspencer / sprite.js
Last active August 29, 2015 14:02
Jquery snippet to animate SVG sprites with rotate and translate
/**
* animate an SVG elemtent
* @param {object} el The element being animated
* @param {integer} x The x coordinate
* @param {integer} y The y coordinate
* @param {integer} deg The degree at which to rotate the element
* @param {integer} time The duration of the animation
*/
var moveSprite = function(el,x,y,deg,time){
var anim = $(el)
@vivianspencer
vivianspencer / MarketoWistiaInit.js
Created September 18, 2014 02:32
Marketo Wistia Integration - Sends Play, 25%, 50%, 75% 100% watched results to Marketo
loadEmbedShepherd(function(){
if(window.wistiaEmbeds===undefined){
return;
}
window.wistiaEmbeds.onFind(function(video) {
video.addPlugin("marketo", {
src: "js/MarketoWistiaPlugin.js",
outsideIframe: true
});
});
@vivianspencer
vivianspencer / gist:be15b2549c0eb189a10b
Last active August 29, 2015 14:06
Wordpress Bedrock Setup
composer create-project roots/bedrock .
git init
composer update
bundle install
wp core install --url="local.example.com" --title="SITE NAME" --admin_user="admin" --admin_password="admin" --admin_email="[email protected]"
@vivianspencer
vivianspencer / breakpoints.scss
Created October 8, 2014 04:34
Media Queries
/* Smartphones (portrait and landscape) */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) */
@media only screen and (min-width : 321px) {
/* Styles */
}
@vivianspencer
vivianspencer / mysql_create_db_user.sql
Last active August 29, 2015 14:13
Create MySQL database and user
mysql -uroot -p
create database DB_NAME;
CREATE USER 'DB_USER' IDENTIFIED BY 'DB_PASSWORD';
GRANT ALL PRIVILEGES ON DB_NAME.* TO 'DB_USER';
exit
@vivianspencer
vivianspencer / fix_perl_locale.sh
Last active August 29, 2015 14:13
Fix Perl locale complaints
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales