Skip to content

Instantly share code, notes, and snippets.

@Kricket
Kricket / Spinner.vue
Created June 21, 2021 09:17
Vue V3 component wrapping spin.js spinner
<!--
Example implementation of a Vue V3 component wrapper for the spin.js library
https://spin.js.org/
-->
<template>
<div ref="spinDiv"></div>
</template>
<style lang="scss">
@jackcviers
jackcviers / Not a nightmare.md
Created March 22, 2021 21:36
Scala isn't a maintenance nightmare

So the hacker news post said my comment was too long. Warning, long, opinionated post:

Scala dev for 10+ years here. Spark is weird. Databricks has a style guide that deliberately chooses not to use scala features that the rest of the community uses, and doesn't follow the same best practices around library and scala major version usage that the rest of the community uses [1]. It's no surprise that the project has trouble interoperating with libraries outside of the spark ecosystem, and is therefore a maintenance problem.

Spark's style and compatibility problems

Scala isn't a maintenance nightmare, but it does attract a lot of newcomers who dive in, don't stick within one of its many ecosystems, get confused, and generally leave a mess, and that is a direct result of the fact that scala is a multi-paradigm, relatively expressive language to the one(s) it is competing with and pulling developers from, and that those developers, for the large part, don't really want to change and think that Scala is just a

@grakic
grakic / HTMLRewriter.js
Created May 3, 2020 21:36
CloudFlare Workers HTMLRewriter mock based on cheerio
import cheerio from 'cheerio'
/**
* TODO: This code is not optimized for production!
* Usage of cheerio here only simulates stream-oriented parser! It is slow!
*/
function replace(content, options) {
// TODO: Handle {html:true/false} in options
this[0].nodeValue = content
@eighteight
eighteight / gist:772851faee1eeb5be7389bca0bbff6fd
Created May 12, 2018 14:09
Restart gaeapp docker image in Google App Engine flexible environment custom runtime with --privileged flag
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if [ -f '/home/gaebuilder/google-cloud-sdk/path.bash.inc' ]; then source '/home/gaebuilder/google-cloud-sdk/path.bash.inc'; fi
if [ "$#" -ne 3 ]; then
echo "Usage $0 [PROJECT] [SERVICE] [APPLICATION_ENV]"
exit 1
fi
project=$1
service=$2
gae_env=$3
@belackriv
belackriv / marionette.stickit.shim.js
Created July 2, 2016 19:10
Marionette Stickit Shim for v3
//credit to https://github.com/bazineta for the original
'use strict';
import * as _ from 'underscore';
import * as Marionette from 'marionette';
// Save original Backbone.Stickit calls.
var stickit = Marionette.View.prototype.stickit;
var addBinding = Marionette.View.prototype.addBinding;
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@xjamundx
xjamundx / blog-webpack-2.md
Last active April 21, 2024 16:20
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@traviskaufman
traviskaufman / logback_disable_in_unit_tests.md
Last active March 20, 2023 08:38
Logback: Disable all logging in unit tests

After scouring the internet and piece-mealing together the correct way to do this, here is a step-by-step, all-in-one-place guide to making logback STFU when running your unit tests.

Here's how to do it

Save the following as logback-test.xml under src/test/resources:

<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern>%msg%n</pattern>
@codyburleson
codyburleson / dust-replace-helper.js
Created October 24, 2014 03:32
String replace helper for Dustjs
(function (dust) {
/**
* Polyfill to create String.trim() if it's not natively available
*/
if (!String.prototype.trim) {
(function(){
// Make sure we trim BOM and NBSP
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function () {
@jbmoelker
jbmoelker / bootstrap.js
Last active January 15, 2016 19:22
requirejs-bootstrap-plugin
// Create shim for requested bootstrap component and require
// and return jQuery so you do not have to inject it separately
// every time you use a bootstrap component.
define({
load: function (name, req, onload, config) {
// Set this path to wherever the bootstrap components live.
// Contents should match https://github.com/twbs/bootstrap/tree/master/js
var component = 'path/to/bootstrap/js/'+name;
var shim = {};