The sources of the project follows this structure:
/src
/app
/{domain}
/actions.ts
/actions.spec.ts
/** | |
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from | |
* a base64 string. | |
* Updated to use Promise (bluebird) | |
* Web: https://mayneweb.com | |
* | |
* @param {string} base64 Data | |
* @return {string} Image url | |
*/ | |
const imageUpload = async (base64) => { |
Download the following repositories and run yarn install
in each:
JavaScript resources, all free online. They're ordered in diffuculty from top to bottom. | |
http://jsforcats.com/ | |
https://www.youtube.com/playlist?list=PLeL6uTxQ-uX_5BpOb2FDNgG6SxjCs59Kv | |
https://www.youtube.com/watch?v=hQVTIJBZook | |
https://www.khanacademy.org/computing/computer-science/algorithms | |
http://speakingjs.com/es5/index.html | |
http://eloquentjavascript.net/index.html | |
http://superherojs.com/ | |
https://www.youtube.com/watch?v=8aGhZQkoFbQ |
var gulp = require('gulp'); | |
var phpspec = require('gulp-phpspec'); | |
var run = require('gulp-run'); | |
var notify = require('gulp-notify'); | |
gulp.task('test', function() { | |
gulp.src('spec/**/*.php') | |
.pipe(run('clear')) | |
.pipe(phpspec('', { notify: true })) | |
.on('error', notify.onError({ |
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// For dev purposes only | |
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' }); | |
// Read in the file, convert it to base64, store to S3 | |
fs.readFile('del.txt', function (err, data) { | |
if (err) { throw err; } |
//requires jQuery | |
$(window).scroll(function(){ | |
var threshold = 200; // number of pixels before bottom of page that you want to start fading | |
var op = (($(document).height() - $(window).height()) - $(window).scrollTop()) / threshold; | |
if( op <= 0 ){ | |
$("#thing-to-hide").hide(); | |
} else { | |
$("#thing-to-hide").show(); | |
} | |
$("#thing-to-hide").css("opacity", op ); |
Route::get('edit', function() { | |
// fetch our post, and it's associated categories | |
$post = Post::with('cats')->where('id', '=', $id)->first(); | |
// fetch all of our categories | |
$cats = Cat::all(); | |
// create our empty array | |
$post_cats = array(); |
<?php | |
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php) | |
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' ); | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
ob_start(); | |
?> | |
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> | |
<?php |