Skip to content

Instantly share code, notes, and snippets.

@ashleydw
ashleydw / gist:a717be3bff10f517f43a
Created April 14, 2015 13:53
reapp build errors
reapp build
Building...
Building with webpack...
Had errors:
./~/reapp-kit/dist/index.js
Module not found: Error: Cannot resolve module 'reapp-ui/all' in /Users/ashley/Sites/MobileReapp/ReappTest/node_modules/reapp-kit/dist
resolve module reapp-ui/all in /Users/ashley/Sites/MobileReapp/ReappTest/node_modules/reapp-kit/dist
looking for modules in /Users/ashley/Sites/MobileReapp/ReappTest
/Users/ashley/Sites/MobileReapp/ReappTest/reapp-ui doesn't exist (module as directory)
@ashleydw
ashleydw / screenshot.php
Last active August 29, 2015 14:17
Capture screenshots using Event Firing Webdriver
<?php
$webdriver = new EventFiringWebDriver(
RemoteWebDriver::create(
'http://localhost:9515',
DesiredCapabilities::phantomjs()
)
);
$webdriver->getDispatcher()->register(new SeleniumEventListener());
@ashleydw
ashleydw / gist:66fbd08de27bd5663634
Created December 12, 2014 09:36
vagrant_devstack_chef_error
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'osi'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: osi
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: hostonly
@ashleydw
ashleydw / nginx.conf
Last active January 8, 2024 15:32
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@ashleydw
ashleydw / magento_add_to_customer_cart.php
Created July 24, 2014 13:12
Magento finding a product and options based on an arbitory string
$_varien = new Varien_Object(array_merge(array(
'product' => $product->getId(),
'qty' => 1,
), $optionsToUse));
/** @var Mage_Customer_Model_Customer $_customer */
foreach ($filters['customers'] as $_customer) {
/**
* try to find a cart for the customer
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "#636363",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#ed444f",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@ashleydw
ashleydw / scrape.js
Created April 16, 2014 19:15
Scraping with phantomjs
var urls = ['put', 'your', 'page', 'urls', 'here'];
page.onConsoleMessage = function (msg) {
if(msg.indexOf('SCRAPE-RESULT:') >= 0) {
var fn = 'file_name_to_write_to.txt';
console.log('writing file', fn)
fs.write(fn, msg.replace('SCRAPE-RESULT:', ''), 'w');
}
@ashleydw
ashleydw / ThinklePaginator.js
Last active October 1, 2015 03:18
Thinkle Mootools Paginator
/**
* Paginating through elements with MooTools
*
* Use:
* new ThinklePaginator(el, options);
*
* @link www.needathinkle.com/tumblr/18254885740
* @version 2
* @author Ashley White, www.needathinkle.com
* @license @license http://creativecommons.org/licenses/by-sa/3.0/
@ashleydw
ashleydw / CSS3_MediaQueries.css
Created February 21, 2012 14:28
CSS 3 Inline Media Queries
/* mobile (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
}
/* mobile (landscape) ----------- */
@media only screen and (min-width : 321px) {
}
@ashleydw
ashleydw / ThinkleScroller.js
Created November 2, 2011 22:46
Create pretty scrolling divs with Mootools
/**
* Pretty scrolling divs for mootools.
*
* Use:
* new ScrollBar(el);
*
* @link www.needathinkle.com/tumblr/12258839049
* @version 2
* @author Ashley White, www.needathinkle.com
* @license @license http://creativecommons.org/licenses/by-sa/3.0/