Skip to content

Instantly share code, notes, and snippets.

View codekipple's full-sized avatar

codekipple

View GitHub Profile
@codekipple
codekipple / vagrantfix
Last active August 29, 2015 14:11
Fix a disassociated vagrant virtual machine
Here is the exact process I followed to fix this on Mac OS X 10.9.5 and vagrant 1.7.2:
1. Get the VM id of the disassociated vm with VboxManage list vms
2. "vagrant up" to spin up a new machine with the original vagrantfile to regenerate the .vagrant dir.
3. Delete the new machine from Virtual Box and remove data.
4. Edit .vagrant/machines/default/virtualbox/id and replaced the id with the one retrieved in step one (beware of line breaks)
Vagrant up -> Success!
@codekipple
codekipple / TODO
Created January 12, 2015 16:24
symfony console component
* symfony console component, Look into using the symfony component console as part of a WordPress site. Check out wp-cli and see if that's what they are using.
@codekipple
codekipple / host-dev-stack
Last active August 29, 2015 14:16
Host dev stack
* git (1.9.3) - brew
* npm (v0.12.0) - brew
* grunt-cli - npm
@codekipple
codekipple / gist:aa027893e6f12992bf88
Last active August 29, 2015 14:16
Vagrant networking hanging
Githubhub user https://github.com/Ramblurr says:
https://github.com/mitchellh/vagrant/issues/3860#issuecomment-76380469
For others who stumble across this bug report while searching, this bug has been fixed in Vagrant, but you can still get the "waiting for" delays if you're /etc/networking/interfaces file has extra ifaces in it.
Boot the machine with VBox Gui, wait the three or so minutes for the machine to boot, then login as root and edit /etc/networking/interfaces and make sure it doesn't have duplicate or extra ethX interfaces.
This happened to me when using Varying-Vagrant-Vagrants/VVV and abruptly halting the machine, and fiddling with VBox's network interfaces.
cloud-init-nonet[4.54]: waiting 10 seconds for network device
<!-- SHOW SHIPPING RATES-->
<?php $quote = Mage::getModel('sales/quote');
$quote->getShippingAddress()->setCountryId('ES'); // Set your default shipping country here
$_product->getStockItem()->setUseConfigManageStock(false);
$_product->getStockItem()->setManageStock(false);
$quote->addProduct($_product);
$quote->getShippingAddress()->setCollectShippingRates(true);
$quote->getShippingAddress()->collectTotals();
$rates = $quote->getShippingAddress()->getShippingRatesCollection();
// Find cheapest rate
@codekipple
codekipple / gist:688b3f4f8ec00eb0c0c4
Created May 12, 2015 10:59
getting postfix setup as a send mail server on ubuntu using a vagrant VM
This could be unrelated but I'm going to post it here because I had a hard time finding the answer to my question. I was able to get outbound email working from a vagrant virtual box by editing my /etc/resolv.conf to use Google's nameserver rather than the 10.0.x.x IP it was set to:
sudo vi /etc/resolv.conf
Change the nameserver IP:
nameserver 8.8.8.8
Then you'll need to restart postfix:
sudo /etc/init.d/postfix restart
@codekipple
codekipple / gist:20e4060d527cf49da87d
Created May 13, 2015 10:50
vertically align things in css
http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
position: relative;
top: 50%;
transform: translateY(-50%);
# if % value on top does not work use absolute positioning
position: absolute;
top: 50%;
transform: translateY(-50%);
@codekipple
codekipple / gist:96e0774c39a2ce9055f6
Created June 4, 2015 09:09
My favourite tools/plugins for frontend work
## Sliders
http://flickity.metafizzy.co/
http://kenwheeler.github.io/slick/
## Images
https://github.com/aFarkas/lazysizes
https://github.com/scottjehl/picturefill
## shims
https://github.com/scottjehl/iOS-Orientationchange-Fix
@codekipple
codekipple / styles.js
Created July 29, 2015 23:40
Gulp example of handling css compilation
var Gulp = require('gulp'),
pkg = require('./../../package.json'),
Sass = require('gulp-sass'),
Postcss = require('gulp-postcss'),
Autoprefixer = require('autoprefixer-core'),
BrowserSync = require('browser-sync');
var cssCompile = function(devMode) {
var outputStyle;
@codekipple
codekipple / jsmc homework part 2
Created March 4, 2011 17:33
javascript master class with Amy Hoy and Thomas Fuchs: Homework part 1
// Part 1.
// Implement a function prototype extension that caches function results for
// the same input arguments of a function with one parameter.
//
// For example:
// Make sin(1) have the result of Math.sin(1), but use a cached value
// for future calls.
//
// Part 2.
// Use this new function to refactor the code example.