This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"begin": "git reset --hard start", | |
"complete": "git reset --hard complete", | |
"previous": "git reset --hard complete", | |
"next": "git reset --hard $(git describe --tags)", | |
"reset": "git reset --hard $(git describe --tags)", | |
"current": "echo \"You are at step \"$(git describe --tags)" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Acl from 'vue-browser-acl' | |
Vue.use(Acl, user, (acl) => { | |
acl.rule(view, Post) | |
acl.rule([edit, delete], Post, (user, post) => post.userId === user.id) | |
acl.rule('moderate', Post, (user) => user.isModerator()) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// run: casperjs --engine=slimerjs create-facebook-app.js | |
// | |
const casper = require('casper').create({ | |
verbose: true, | |
loglevel: 'debug', | |
}) | |
/* captures every step */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Based on ideas described here: https://medium.com/@mblarsen/wordpress-style-shortcodes-using-vue-js-d2acd20f403f */ | |
<script> | |
import 'babel-polyfill' | |
import { default as Tokenizer } from 'shortcode-tokenizer' | |
import Vue from 'vue' | |
import Row from 'components/ui/Row' | |
import Column from 'components/ui/Column' | |
import ProductList from 'components/content/ProductList' | |
import ProductCard from 'components/content/ProductCard' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Supawdog\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\ProcessUtils; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Process\PhpExecutableFinder; | |
class WebpackCommand extends Command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codeboutique.dev:80 { | |
root /var/www/codeboutique | |
gzip | |
tls off | |
log stdout | |
errors stderr | |
fastcgi / /run/php/php7.0-fpm.sock php { | |
ext .php | |
index index.php index.html | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/code/local/Namespace/Modulename/Eav/Model/Entity/Increment/Numeric.php | |
/** | |
* Changes the next id behaviour so that all stores share the same increment | |
* for orders, invoces, creditmemos and shipments if they share the same | |
* increment prefix. | |
* | |
* 1. In eav_entity_type leave increment_model to be the default eav/entity_increment_numeric | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Moves Github zipped-repo files into root of zip files | |
# | |
# knockout-master.zip: | |
# | |
# knockout-master/<all files> | |
# | |
# to: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Override arrayFirst (but remain backward compatible) | |
ko.utils._arrayFirst = ko.utils.arrayFirst | |
ko.utils.arrayFirst = function (array, ...predicateParams) { | |
// In case used as regular arrayFirst | |
if (typeof predicateParams[0] === 'function') { | |
return ko.utils._arrayFirst(array, predicateParams[0]) | |
} | |
// Otherwise wrap | |
return ko.utils._arrayFirst(array, ko.utils.objectPredicate(...predicateParams)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elementAt : List a -> Int -> Maybe a | |
elementAt xs n = | |
case List.drop (n - 1) xs of | |
[ ] | |
-> Nothing | |
y::ys | |
-> Just y |