Skip to content

Instantly share code, notes, and snippets.

Edmund vssn

Block or report user

Report or block vssn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vssn
vssn / yo.js
Created Dec 17, 2018
Combine template strings with custom functions
View yo.js
function endSentenceWithYo(template, ...expressions) {
return template.reduce((accumulator, part, i) => {
return accumulator + expressions[i - 1] + part
}) + ", yo!"
}
let type = 'delivery guy';
let name = 'Barry';
let says = 'Here ye go';
@vssn
vssn / bind.js
Created Apr 25, 2018 — forked from WickyNilliams/bind.js
Super simple one-way data-binding
View bind.js
/**
* follows a path on the given data to retrieve a value
*
* @example
* var data = { foo : { bar : "abc" } };
* followPath(data, "foo.bar"); // "abc"
*
* @param {Object} data the object to get a value from
* @param {String} path a path to a value on the data object
* @return the value of following the path on the data object
@vssn
vssn / Cors.php
Created Mar 16, 2018 — forked from drewjoh/Cors.php
Laravel CORS Middleware
View Cors.php
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
You can’t perform that action at this time.