Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 23:34 (UTC +02:00)
  • X @iskostja
View GitHub Profile
@winuxue
winuxue / puppeteer-ubuntu-1804.md
Created May 22, 2019 01:15
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1
@hansemannn
hansemannn / deep-linking-manager.js
Created May 20, 2019 10:06
Titanium Deep Linking Manager (iOS)
export default class DeepLinkingManager {
constructor () {
this.handledLinks = {};
this.activityType = 'io.lambus.app.universalLink';
const activity = Ti.App.iOS.createUserActivity({
activityType: this.activityType
});
//Use below code snippet to Schedule Async Framework to run every 15 minutes and clear the queue
//Scheduler Run every 15 mins
AsyncApexFrameworkScheduler obj1 = new AsyncApexFramework();
AsyncApexFrameworkScheduler obj2 = new AsyncApexFramework();
AsyncApexFrameworkScheduler obj3 = new AsyncApexFramework();
AsyncApexFrameworkScheduler obj4 = new AsyncApexFramework();
System.schedule('AsyncApexFramework 1', '0 0 * * * ?', obj1);
System.schedule('AsyncApexFramework 2', '0 15 * * * ?', obj2);
System.schedule('AsyncApexFramework 3', '0 30 * * * ?', obj3);
//
// ComNextchapterOrangeModule.swift
// orange
//
// Created by Your Name
// Copyright (c) 2019 Your Company. All rights reserved.
//
import UIKit
import TitaniumKit
@hansemannn
hansemannn / app-utils.js
Last active October 15, 2019 20:16
Using ES7+ async/await in Appcelerator Titanium
export function showOptions (args) {
const title = args.title;
const message = args.message;
const options = args.options;
const destructive = args.destructive !== undefined ? args.destructive : -1;
let cancel = -1;
return new Promise((resolve, reject) => {
if (OS_IOS) {
options.push('Cancel');
@hansemannn
hansemannn / cache.js
Created December 12, 2018 10:19
Caching remote images in Titanium (asynchronously)
export default class Utils {
static loadCachedImageFromURL(url, cb) {
let filename;
try {
filename = url.substring(url.lastIndexOf('/') + 1);
} catch (err) {
cb(null);
}
@jasonkneen
jasonkneen / gitconfig
Created November 16, 2018 11:48
Getting release notes from Git logs
# drop this into your ./.gitconfig file
# usage
# $ git today
# $ git yesterday
# $ git since 18-11-01
#
# will display a list of formatted commits you can lift to use for release notes
[alias]
today = log --since=1am --pretty=format:"%C(blue)-\\ %s"
CheckEC2TargetStatus:
Type: Task
Resource: ${self:custom.function-arn}-CheckEC2TargetStatus
Next: EvaluateEC2TargetStatus
ResultPath: '$.onEC2TargetStatus'
Retry:
- ErrorEquals:
- RequestLimitExceeded
- ThrottlingException
- SnapshotCreationPerVolumeRateExceeded
@hansemannn
hansemannn / liveview-from-cli.md
Last active December 9, 2022 17:12
Use LiveView from the Titanium CLI (without Studio)
  1. Install LiveView globally:
npm i -g liveview
  1. Change the ~/.titanium/config.json to include the CLI hook (under paths -> hook):
{
	"user": { ... },
	"app": { ... },
	"cli": { ... },
@joshjhargreaves
joshjhargreaves / readme.md
Last active September 7, 2018 04:05
Consuming Blobs in a Native Module in React Native

Blob support landed in React Native in 0.54.

In effect this means you can hold a reference in JS to a resource which exists on the native side, and pass it to a native module without needing a round trip of the serialised data over the bridge and back.

JS side, you can retrieve a blob from fetch like so, which you can then pass to your native module.

const response = await fetch(BLOB_URL);
const blob = await response.blob();
...
blob.clear();