Skip to content

Instantly share code, notes, and snippets.

View mordka's full-sized avatar
🌏
The future is now.

mordka mordka

🌏
The future is now.
View GitHub Profile
@mordka
mordka / fix_gcc_compat.patch
Created January 14, 2020 18:53
Fixes breaking PotreeConverter build using the newest gcc
From dc515c42fbb7181e03bf0b228b78dd091696d1c5 Mon Sep 17 00:00:00 2001
From: mordka <mordka@anonymous.com>
Date: Tue, 14 Jan 2020 17:52:08 +0000
Subject: [PATCH] fix gcc err
---
PotreeConverter/src/PotreeWriter.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PotreeConverter/src/PotreeWriter.cpp b/PotreeConverter/src/PotreeWriter.cpp
@mordka
mordka / potree.js
Last active September 23, 2018 14:59
Convert meters to feet based on locale
Potree.KeyCodes = {
DELETE: 46
};
THREE.EventDispatcher.prototype.removeEventListeners = function (type) {
if (this._listeners === undefined) {
return;
}
if (this._listeners[ type ]) {
@mordka
mordka / service-worker-ghost-cms.js
Last active July 1, 2022 11:42 — forked from deanhume/service-worker-ghost-cms.js
Service Worker for Ghost CMS - ignore Ghost admin
const cacheName = 'blogCache';
const offlineUrl = '/offline/';
const adminPageSlug = '/ghost';
/**
* The event listener for the service worker installation
*/
self.addEventListener('install', event => {
event.waitUntil(
caches.open(cacheName)
alizarin
amaranth
amber
amethyst
apricot
aqua
aquamarine
asparagus
auburn
azure
@mordka
mordka / stubs.app-test.js
Last active October 22, 2020 10:57
Stub Meteor.userId()
// This file will be auto-imported in the app-test context,
// ensuring the method is always available
import { Meteor } from 'meteor/meteor';
import { sinon } from 'meteor/practicalmeteor:sinon';
function stubUser(currentUserId) {
if (!Meteor.userId()) { //dont stub twice just in case
sinon.stub(Meteor, 'userId', () => currentUserId);
sinon.stub(Meteor, 'user', () => Meteor.users.findOne({ _id: currentUserId }));
@mordka
mordka / Regular saver interest calculator
Created March 29, 2015 11:58
Calculates regular saver effective interest rate, assuming you pay in 250 each first day of month over 1 year period.
class Rounding {
public BigDecimal round(int n) {
return setScale(n, BigDecimal.ROUND_HALF_UP);
}
}
class Taxable {
def defaultTaxRate = 0.2
public afterTax(taxRate=defaultTaxRate) {
return this * (1-taxRate);