Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 17:02 (UTC +02:00)
  • X @iskostja
View GitHub Profile
@zhiyue
zhiyue / export.sh
Created June 25, 2021 17:12 — forked from jazzqi/export.sh
Export apps installed by brew, brew cask and Mac App Store(using mas)
#!/bin/bash
echo -e '#!/bin/bash\n' > list.sh
echo -e '########### Brew Install List ###########' >> list.sh
brew leaves | sed 's/^/brew install /' >> list.sh &&
echo -e '\n########### Brew Cask Install List ###########' >> list.sh &&
brew cask list | sed 's/^/brew cask install /' >> list.sh &&
echo -e '\n########### Mac App Store Install List ###########' >> list.sh &&
@sindresorhus
sindresorhus / esm-package.md
Last active April 26, 2024 03:53
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@ewanharris
ewanharris / check-module.sh
Last active January 11, 2021 08:55
Script to check Titanium modules for references to UIWebView
#!/usr/bin/env bash
FOLDER=$1
echo "Checking $FOLDER"
# Check for references to UIWebView in the build .a files using strings
for file in "$FOLDER"/*.a; do
strings "$file" | grep UIWeb > /dev/null 2>&1
if [ $? -eq 0 ]
@gbutt
gbutt / BatchGrantPermissionSet.cls
Created February 8, 2020 15:57
Grant Permission Set or Permission Set Group to Users in Batch Apex
/**
* Assigns a permission set or permission set group to all user with the specified profile.
* Additional filter criteria can be passed in if the users needs filtered further.
* Example: Only assign permission set to community users on the Salesforce account
* String filter = 'Contact.Account.Name = \'Salesforce\'';
* BatchGrantPermissionSet('Community User Profile', 'Salesforce_Account_Privs', filter);
*/
public class BatchGrantPermissionSet implements Database.Batchable<sObject> {
String query {get; set;}
@damianmcdonald
damianmcdonald / README.md
Last active November 23, 2022 10:45
Node.js application which creates an S3 bucket and uploads a file with permissions and metadata

Overview

A Node.js application which creates an S3 bucket and uploads a file with permissions and metadata.

This example uses the createBucket and upload methods of the AWS SDK for JavaScript.

See API doocumentation for detailed information; https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html

To see the available parameters for the s3 upload method, see the paramObjects.js file.

@enricop89
enricop89 / cloudformation-role.json
Created September 27, 2019 13:59
Serverless IAM Permission
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"lambda:CreateFunction",
"lambda:ListVersionsByFunction",
"dynamodb:DeleteItem",
trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) {
List<BatchLeadConvertErrors__c> errors = new List<BatchLeadConvertErrors__c>();
for(BatchApexErrorEvent event : Trigger.New) {
BatchLeadConvertErrors__c blcerror = new BatchLeadConvertErrors__c();
blcerror.AsyncApexJobId__c = event.AsyncApexJobId;
blcerror.Records__c = event.JobScope;
blcerror.StackTrace__c = event.StackTrace;
errors.add(blcerror);
@enepomnyaschih
enepomnyaschih / base64.js
Last active March 6, 2024 23:45
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
<template>
<div lwc:dom="manual" class="slds-hide"></div>
</template>