Skip to content

Instantly share code, notes, and snippets.

View sagalbot's full-sized avatar
🏔️

Jeff Sagal sagalbot

🏔️
View GitHub Profile
@sagalbot
sagalbot / gulpfile.js
Last active April 13, 2018 05:03
Laravel Elixir + Vueify + Hot Reload. This will get you up and running with Browserify HMR + Vueify + BrowserSync in no time.
var elixir = require('laravel-elixir');
var gutil = require('gulp-util');
// If 'gulp watch' is run
if (gutil.env._.indexOf('watch') > -1) {
// Enable watchify for faster builds
elixir.config.js.browserify.watchify.enabled = true
@sagalbot
sagalbot / karma.conf.js
Created April 29, 2016 19:28
Karma Config for Webpack/Vue/Jasmine
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
files: ['test/**/*.js'],
reporters: ['spec'],
preprocessors: {
'test/*.js': ['webpack']
},
singleRun: true,
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
# echo '○'
echo '→'
}
<style lang="scss">
.github-search {
&.panel-default {
border: none;
}
.panel-heading,
.panel-footer {
background: none;
}
@sagalbot
sagalbot / bootstrap.php
Created April 1, 2017 22:50
Testing boilerplate for a WooCommerce extension.
<?php
/**
* PHPUnit bootstrap file
*
* @package Cli_Tests
*/
$wc = getenv( 'WC_TESTS_DIR' ) ? getenv( 'WC_TESTS_DIR' ) : '/tmp/woocommerce/tests';
$wp = getenv( 'WP_TESTS_DIR' ) ? getenv( 'WP_TESTS_DIR' ) : '/tmp/wordpress-tests-lib';
@sagalbot
sagalbot / Container.php
Last active April 5, 2017 19:35
A bare-bones PHP IoC container.
<?php
interface Container
{
static function bind($name, Callable $resolver);
static function make($name);
}
@sagalbot
sagalbot / livetemplate
Created June 5, 2017 18:42
PHPStorm Live Template For PHPUnit Tests
/**
* @test
*/
public function $METHOD$()
{
// $TEST$$END$
}
@sagalbot
sagalbot / disable-xdebug.sh
Created August 4, 2017 19:35 — forked from hacfi/disable-xdebug.sh
OS X homebrew php 7.0 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
echo "xdebug disabled"
@sagalbot
sagalbot / yarn_install.sh
Last active May 31, 2020 16:03
Quick Yarn Installs on Laravel Envoyer, share `node_modules` between deployments.
cd {{ release }}
# link node_modules from last deployment
ln -s {{ project }}/node_modules
# update linked folder with latest deps
yarn install
# remove the symlink
rm node_modules
@sagalbot
sagalbot / FuseFilter.vue
Created May 22, 2019 18:04
Using Fuse.js to filter items in Vue Select
<template>
<v-select :filter="fuseSearch" :options="books" :getOptionLabel="option => option.title">
<template #option="{author, title}">
{{ title }} <br>
<cite>{{ author.firstName }} {{ author.lastName }}</cite>
</template>
</v-select>
</template>
<script>