This file contains 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 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 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 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 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 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 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 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 |
This file contains 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 | |
class A { | |
public $param = 7; | |
} | |
class B { | |
private $param = 28; | |
} |
This file contains 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
/** | |
* Knockout.js extension that gives both new and old value to | |
* subscription functions. | |
* | |
* Credit: http://stackoverflow.com/a/18184016/204610 | |
* | |
* Changed JBeagle's code to return a disposable subscription | |
* object so it conforms to subscribe() | |
*/ | |
ko.subscribable.fn.subscribeChanged = function (callback) { |