Skip to content

Instantly share code, notes, and snippets.

View rkistner's full-sized avatar

Ralf Kistner rkistner

View GitHub Profile
@rkistner
rkistner / chrome.ts
Created December 5, 2017 12:34
Using Chrome on Lambda
import { spawn, execSync, ChildProcess } from 'child_process'
import * as net from 'net'
const { chromePath } = require('aws-lambda-chrome');
const Cdp = require('chrome-remote-interface');
export type ChromeHandler<T> = (client: ChromeClient) => Promise<T>;
// These security features are not supported at all, and need to be disabled.
@rkistner
rkistner / lint.js
Created May 15, 2014 13:27
tern.lint + jshint
// Set the linter on the codemirror instance
options.lint = { getAnnotations: asyncValidator, async: true }
function asyncValidator(cm, updateLinting, options) {
// jshint
var jshint = performJSHint(cm.getValue());
// tern.lint, adapted from tern-lint.js
var query = {
type : "lint",
@rkistner
rkistner / android_install.rb
Created August 6, 2013 10:18
Automated installation of Android SDK components
require 'pty'
require 'expect'
def parse_android_packages(packages_raw)
packages_raw = packages_raw.split("\n----------\n")
result = []
packages_raw.each do |raw|
id_match = /id: (\d+) or "(.+)"/.match(raw)
@rkistner
rkistner / pom.xml
Created February 13, 2013 11:28
Upload Maven artifacts to remote S3 repository
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>mvnuploader</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Uploader</name>
<build>
<extensions>
@rkistner
rkistner / pom.xml
Created December 11, 2012 07:33
helloflashlight with manifest-update and mergeManifests (failing)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.simpligility.android</groupId>
<artifactId>helloflashlight</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>HelloFlashlight</name>
<dependencies>
@rkistner
rkistner / myapp_pom.xml
Created December 6, 2012 12:32
Android library project + lightweight application using it with Maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>myproject</artifactId>
<groupId>com.example</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>myapp</artifactId>