Skip to content

Instantly share code, notes, and snippets.

#Prevent vbguest plugin from installing latest guest additions
config.vbguest.auto_update = false if Vagrant.has_plugin?("vagrant-vbguest")
@bassettsj
bassettsj / post-job-event-log.md
Last active August 29, 2015 14:23
job-post-event-log

Job Post Event Logs

impressionLog

{
        event: 'impression',
        location: 'job_post_page',
        data: [{
 isNewClient: data.isNewClient
@bassettsj
bassettsj / fixture-record.txt
Last active August 29, 2015 14:22
Fixtures recording gist
$ ./bin/phpunit-record-fixtures --filter testContractorProfileShouldHavePrivacy ./src/Odesk/Bundle/MobileBundle/Tests/Controller/RecruitControllerTest.php
Recording fixtures
Running phpunit
#!/usr/bin/env php
PHPUnit 4.4.1 by Sebastian Bergmann.
E
Time: 32 ms, Memory: 4.25Mb
@bassettsj
bassettsj / protractor-error.txt
Created June 4, 2015 17:46
protractor error
✘  ~/Sites/mobile-protractor   master ●  protractor protractor.conf.js --verbose --specs=./specs/EOM-1611_spec.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://172.24.11.65:59913/wd/hub
EOM-1611, Verify hire flow for ghost post hourly job:
✓ Open login page (7046ms)
1) Login as client
2) Click "Menu >> Freelancers, select a Saved Freelancer
<li
ng-repeat="step in steps"
ng-class="{next: $index <= currentStep, 'ss-record': currentStep <= $index, 'ss-check': currentStep > $index }">
{{$index + 1}}. {{step.name}}
</li>
@bassettsj
bassettsj / post-commit
Created August 30, 2014 16:01
Git hooks to compile the assets to production
#!/bin/sh
echo
if [ -a .commit ]
then
rm .commit
grunt --base=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz --gruntfile=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz/Gruntfile.coffee
git add sites/all/themes/greenbiz/css
git add sites/all/themes/greenbiz/js/dist
git add sites/all/themes/greenbiz/styleguide
git commit --amend -C HEAD --no-verify
@bassettsj
bassettsj / loadingIndicator.js
Last active August 29, 2015 14:05
Question writing a unit test for a directive that shows an loading indicator on broadcast events.
/**
* Simple directive to show a loading indicator throughout the app.
*
*/
app.directive('loadingIndicator', function () {
return {
template: '<div ng-show="loading" class="loading-indicator"><span aria-hidden="true" class="ss-loading rotate-right"></span><span class="sr-only">Loading...</span></div>',
restrict: 'EA',
link: function postLink(scope, element, attrs) {
scope.loading = true;
@bassettsj
bassettsj / post-commit
Last active August 29, 2015 14:04
Execute Grunt Compile on commit
#!/bin/sh
echo
if [ -a .commit ]
then
rm .commit
grunt --base=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz --gruntfile=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz/Gruntfile.coffee
git add sites/all/themes/greenbiz/css
git add sites/all/themes/greenbiz/js/dist
git commit --amend -C HEAD --no-verify
fi
.directive('allowedNumbers',function(){
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, el, attrs, ctrl){
function fromUser(text) {
var old = ctrl.$modelValue || '';
//console.log(old);
//console.log(text);
if(RegExp(/^(\d{0,9}(\.\d{0,4})?)$/).test(text)) {
/**
* Implements template_preprocess_panels_pane().
*
*/
function greenbiz_events_preprocess_panels_pane(&$variables){
$pane = $variables['pane'];
// Change the variables to match the bootstrap panel component
if ( $pane->subtype == 'gbz_event_sponsors-sponsor_level_pane'){
// Remove the pane-title class and add the bootstrap panel-title class
$variables['title_attributes_array']['class'] = array( 'panel-title' );