Skip to content

Instantly share code, notes, and snippets.

View dsturm's full-sized avatar

Daniel Sturm dsturm

View GitHub Profile
@ahmadawais
ahmadawais / VSCode_Node_Babel_Recipe.md
Last active November 1, 2022 11:31
VSCode Node + Babel Recipe | Solves: vscode debug unexpected token import

VSCode Node + Babel Recipe

Debug Modern JavaScript with VSCode. Part of VSCode Course.

1. init a module:

npm init -y
<template>
<div>
<a href="#" @click.prevent="show" class="w-full">
<img class="w-64" :src="thumbnail">
</a>
<div class="lightbox fixed pin z-50 flex justify-center items-center" v-if="visible" @click="hide">
<div class="fixed pin-r pin-t text-white cursor-pointer text-4xl p-1 mr-2" @click.stop="hide">&times;</div>
<div class="flex">
<div class="cursor-pointer self-center px-8"
@click.stop="prev"
@Shelob9
Shelob9 / links.md
Last active February 13, 2019 14:01
Install WP CLI's scaffold command, create a plugin, add two blocks to the plugin and then activate it.
@ianmjones
ianmjones / build-as3cf-aws2.sh
Last active March 21, 2025 19:21
A script for downloading the AWS PHP SDK v2, stripping down to S3 functionality and then applying a custom namespace.
#!/usr/bin/env bash
set -e
if [ ! -d src/amazon-s3-and-cloudfront ]; then
echo 'This script must be run from the repository root.'
exit 1
fi
for PROG in composer find sed
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
<title>Switcher</title>
<g class="nc-interact_switcher-c-48">
<rect x="2" y="11" width="44" height="26" rx="13" ry="13" fill="#d1d1d1"/>
<rect class="nc-switcher-background" x="2" y="11" width="44" height="26" rx="13" ry="13" fill="#72C472" opacity="0"/>
<circle cx="15" cy="24" r="11" fill="#fff"/>
</g>
<script>
(function() {
@MWDelaney
MWDelaney / advanced-custom-fields.php
Last active February 20, 2019 14:51
Advanced Custom Fields drop-in functionality for Sage 9
<?php
namespace App;
/**
* Advanced Custom Fields drop-in functionality for Sage 9
* Version: 1.0
* Author: Michael W. Delaney
*/
@mookofe
mookofe / githubController.php
Last active December 7, 2018 07:52
Github Webhooks
<?php
namespace App\Http\Controllers;
use Route;
use Illuminate\Http\Request;
class GitHubController extends Controller
{
@goranseric
goranseric / Access-Control-Allow-Origin.php
Created May 23, 2017 17:54 — forked from brunoleles/Access-Control-Allow-Origin.php
Access-Control-Allow-Origin Snipet
<?php
// tells the CDN that the content 'Vary' depending on 'Origin' request header
header('Vary: Origin', true);
// allowed origins
$allowed_http_origins = array(
'http://example.com',
'http://www.example.com',
'http://127.0.0.1',
@tlhunter
tlhunter / average-geolocation.js
Created May 17, 2017 18:00
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**