Skip to content

Instantly share code, notes, and snippets.

View indus's full-sized avatar
♾️

Stefan Keim indus

♾️
View GitHub Profile
@indus
indus / in.ts
Last active March 4, 2021 19:12
Typescript Pattern for Vue Components
module MyModule {
export class MyClass extends Vue {
// define instance methods
myMethod() {
// the TS-Type of "this" is defined as Instance of MyClass
console.log("myMethod");
}
myOtherMethod() {
console.log("myOtherMethod");
@indus
indus / vue.d.ts
Created June 26, 2015 05:39
vue 12.1 definition
// 0.12.1
declare class Vue {
// constructor
constructor(instanceOpt?);
// static
static cid: number;
static compiler: {
compile: (el, options, partial, transcluded) => any;
@indus
indus / allinone.js
Last active August 12, 2016 12:25
bjs\ntest
suite.add('RegExp#test', function() {
/o/.test('Hello World!');
})
.add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
})
.add('String#match', function() {
!!'Hello World!'.match(/o/);
})
@indus
indus / unvincenty.js
Created September 2, 2016 07:48
calculates a coordinate form a coordinate, a bearing and a distance
function unvincenty(lnglat, brng, dist) {
var a = 6378137,
b = 6356752.3142,
f = 1 / 298.257223563,
d2r = 0.017453292519943295,
r2d = 57.29577951308232,
s = dist,
alpha1 = brng * d2r,
sinAlpha1 = Math.sin(alpha1),
cosAlpha1 = Math.cos(alpha1),
@indus
indus / nodep package.json
Last active July 7, 2024 01:37
my minimal bower replacement: just download the package.json (or copy the script over to yours) and hit "npm install".
{
"name": "bower-replacement",
"version": "0.0.1",
"description": "bower replacement made simple (noDep)",
"scripts": {
"postinstall":"npm link download && node -e \"require('./package.json').download.forEach(a => require('download').apply(0,a))\" && npm unlink download"
},
"download": [
["https://gist.github.com/favicon.ico","."],
["https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js","src/script/org"],
@indus
indus / h3_res0_seq_split.json
Created November 3, 2021 10:23
rasterstats
{"type":"Feature","properties":{"id":"8001fffffffffff"},"geometry":{"type":"Polygon","coordinates":[[[-180,90],[-180,86.19672397564817],[-34.75841798028471,81.27137179020501],[0.32561035194326043,73.31022368544396],[31.831280499087402,68.92995788193984],[62.345344956509784,69.3935964899183],[94.14309010184775,76.16304283019099],[145.5581976913369,87.3646953231962],[180,86.19672397564817],[180,90],[-180,90]]]}}
{"type":"Feature","properties":{"id":"8003fffffffffff"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-180,79.78584885824509],[-163.45686807900947,76.14556732608256],[-131.70883908792965,69.37134141076518],[-100.82187020582201,67.53592431503803],[-66.90449925088507,72.20470505499345],[-34.758417980284634,81.27137179020501],[-180,86.19672397564817],[-180,79.78584885824509]]],[[[145.5581976913369,87.3646953231962],[180,79.78584885824509],[180,86.19672397564817],[145.5581976913369,87.3646953231962]]]]}}
{"type":"Feature","properties":{"id":"8005fffffffffff"},"geometry":{"type":"MultiPolygon","coordin
@indus
indus / test.json
Created November 15, 2021 09:41
test
{
"date":[1234]
}
@indus
indus / test.js
Created June 23, 2024 11:35
ms_test
export default ()=>{console.log("just a test")}
@indus
indus / test.js
Created July 2, 2024 06:16
ms_script
module.exports = {
test(){
console.log("just a test");
}
}