Skip to content

Instantly share code, notes, and snippets.

View davedub's full-sized avatar
🏠
Working from home

David Witus davedub

🏠
Working from home
View GitHub Profile
@davedub
davedub / vite.config.js
Created March 5, 2023 23:51
Adding noExternal option to vite.config.js
// Plugins
import vue from "@vitejs/plugin-vue";
import ssr from "vite-plugin-ssr/plugin";
import vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
// Utilities
import { defineConfig } from "vite";
import { fileURLToPath, URL } from "node:url";
// https://vitejs.dev/config/
@davedub
davedub / gist:4e94f9ed9a3f4a18ad310761c4fc4a7a
Last active July 15, 2020 04:05
Deno byl Ryan Dahl - discussion
Program with Erik YouTube Video
Is Deno going to replace Node.js?
- An introductory tutorial
Deno key features
- Typescript
- security model: by default
- changes package manager model
If you just want to play around, --allow-all -A
#custom routes in giglawbusdev.com
routes:
/:
template: home
data: page.home
/about/:
template: about
data: page.about
/contact/:
@davedub
davedub / 0-README.md
Created February 3, 2019 17:55 — forked from lstude/0-README.md
Add Indent / Outdent Functionality to Google Spreadsheets

This tutorial demonstrates how to add an "Indent Text" menu item to a Google spreadsheet so you can indent/outdent text.

  • When the "Indent Text" menu item is selected, any cells within a single column selection will be indented by 5 spaces.

  • You can increase or decrease the number of spaces the text is indented by changing the line below so that the "5" is changed to a larger or smaller number (depending on your preference):

newValues.push(['=CONCAT(REPT( CHAR( 160 ), 5),"' + values[i][0] + '")']);
@davedub
davedub / wikijs_github_heroku.md
Last active May 12, 2021 15:03
Wiki.js on Heroku & Github

How to Get a Wiki.js app running on Heroku & Github

Overview

Setting up a Wiki JS app on Heroku, with individual pages within the app pulled from Github, is documented by Requarks, which created Wiki JS, but I found it confusing to follow. This summary attempts to remove some of the mystery of what finally worked for me.

Setup

  1. If you don't have a Heroku account, create one. Apps that run on shared "dynos" (which is what the no-charge tier plan offers) are free.
// solution for "writing arrow functions" exercise
// https://repl.it/student/classrooms/27654
const example1 = {
stuff: [1, 2, 3, 4, 5, 6, 7],
otherBits: [],
addStuff: function() {
this.stuff.forEach(function(thing) {
this.otherBits.push(thing)
})
@davedub
davedub / prototype_example.js
Last active July 6, 2017 00:33
Prototype model of inheritance in Javascript
/*
"In JavaScript, a prototype is a property of functions and of objects that are created by constructor functions.
The prototype of a function is an object. Its main use is when a function is used as a constructor."
http://msdn.microsoft.com/en-us/library/hh924508(v=vs.94).aspx
"Since Javascript doesn't exactly have sub-class objects, prototype is a useful workaround to make a "base class"
object of certain functions that act as objects."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype
@davedub
davedub / gist:4591814
Last active December 11, 2015 11:08
sml recursion
(* in sml, this works to return true *)
fun num_in_month (days: (int * int * int) list, month: int) =
if (#2 (hd days)) = month then
true
else
false
(* val num_in_month = fn : (int * int * int) list * int -> bool
- num_in_month([(2012,1,22),(2012,3,2),(2012,1,1)],1);
@davedub
davedub / searchbox.php
Created December 1, 2012 19:45
Add searchbox function to header in Shoestrap child theme for Roots
<?php
function shoestrap_header_searchbox() {
// * @param boolean $echo Default to echo and not return the form.
$show_searchbox = get_theme_mod( 'shoestrap_header_searchbox' );
if ( $show_searchbox != '0' ) {
echo('<ul class="pull-right nav nav-collapse"><li>');
get_search_form();
@davedub
davedub / gist:1851022
Created February 17, 2012 05:47
error_on_creating_comments.feature
Background: # features/creating_comments.feature:6
Given there are the following users: # features/step_definitions/user_steps.rb:1
| email | password |
| user@ticketee.com | password |
And I am signed in as them # features/step_definitions/user_steps.rb:15
And there is a project called "Ticketee" # features/step_definitions/project_steps.rb:1
And "user@ticketee.com" can view the "Ticketee" project # features/step_definitions/permission_steps.rb:3
And "user@ticketee.com" has created a ticket for this project: # features/step_definitions/ticket_steps.rb:1
| title | description |
| Change a ticket's state | You should be able to create a comment |