Skip to content

Instantly share code, notes, and snippets.

View madebycaliper's full-sized avatar

Eli Silverman madebycaliper

View GitHub Profile
@madebycaliper
madebycaliper / php.json
Last active December 3, 2023 17:27
VSCode Snippets to Convert to and from Standard Function to Arrow Function
// Place this snippet in php.json to allow it only in PHP files
{
// Other Snippets Here
"Convert PHP function to arrow function": {
"prefix": "convertToArrow",
"body": [
"${TM_SELECTED_TEXT/function\\s*\\(([^)]*)\\)\\s*\\{\\s*return\\s+([^;]+);\\s*\\}/fn($1) => $2/}"
],
@madebycaliper
madebycaliper / sass-math-div.code-snippets.json
Last active August 24, 2022 21:49
Vue.js Sass 2.0 Slash Division Migration Helpers
{
"Vue sass division wrap": {
"prefix": "mathdiv",
"body": ["math.div($TM_SELECTED_TEXT)"],
"description": "Wrap selection with math.div() to address deprecated sass division syntax"
}
}
@madebycaliper
madebycaliper / config.md
Last active September 11, 2021 23:03
Laravel + VScode + xdebug 3.x + setup on Mac

Add a configuration to the debug panel in VSCode

// launch.json
{

  "version": "0.2.0",
  "configurations": [
    {
      "name": "Laravel XDebug",
 "type": "php",
@madebycaliper
madebycaliper / routes.api.index.js
Last active December 11, 2018 19:22
Async Node Response
// ./routes/api/index.js
// the router is already using /api (see routes/index.js), so this is actually a post to /api/
router.post('/', function(req, res) {
// we have to wrap our *await* commands in
// an async function for them to work
(async () => {
// Generate the PDF
.
.