Skip to content

Instantly share code, notes, and snippets.

Chris Gunawardena chris-gunawardena

Block or report user

Report or block chris-gunawardena

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chris-gunawardena
chris-gunawardena / test-gen.js
Last active Jul 6, 2018
polymer test generator
View test-gen.js
copy(Reflect.ownKeys(Reflect.getPrototypeOf(element)).filter(p=>element [p] instanceof Function).map(funcName => `
suite('${funcName}()', () => {
test('yyyyy', () => {
assert.equal(element.${funcName}(''), 'xxxx');
});
});
`).join(''))
/* sample output */
suite('_getWeek', () => {
View server.js
var express = require('express')
var app = express()
var port = 8081;
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS");
next();
});
View remote ssh tunnel
ssh -NT -R 12345:localhost:22 root@mqtt.chris.gunawardena.id.au -o ServerAliveInterval=60
ssh -p12345 chris@localhost
https://blog.kylemanna.com/osx/ssh-reverse-tunnel-on-mac-os-x/
View action.json
{
"actions": [{
"name": "actions.devices",
"deviceControl": {
},
"fulfillment": {
"conversationName": "automation"
}
}],
"conversations": {
View syc.json
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"devices": [{
"id": "456",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.Brightness",
"action.devices.traits.ColorSpectrum"
View charles_android_simulator.sh
!#
/Users/`whoami`/Library/Android/sdk/tools/emulator -avd `android list avd | grep Name -m 1 | cut -c 10-99` -http-proxy `ipconfig getifaddr en0`:8888
View .gitlab-ci.yml
image: chrisgunawardena/android-sdk-23-24:latest
variables:
ANDROID_COMPILE_SDK: "25"
ANDROID_BUILD_TOOLS: "24.0.0"
ANDROID_SDK_TOOLS: "23.0.3"
before_script:
- chmod +x ./gradlew
View Fastfile
# More documentation about how to customize your build
# can be found here:
# https://docs.fastlane.tools
fastlane_version "1.109.0"
default_platform :android
lane :alpha do
if ENV["hockey_api_token"] == nil
abort("\n\nERROR: Please set the hockey_api_token ENV variable and try again.\n\n")
@chris-gunawardena
chris-gunawardena / Dockerfile
Last active Nov 10, 2018
Android apk build docker image
View Dockerfile
FROM openjdk:8-jdk
ENV ANDROID_HOME /opt/android-sdk-linux
RUN dpkg --add-architecture i386
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libc6:i386 libstdc++6:i386 libgcc1:i386 libncurses5:i386 libz1:i386
View create_docker_service.sh
#
docker run -d --name gitlab-runner-config \
-v /etc/gitlab-runner \
busybox:latest \
/bin/true
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
--volumes-from gitlab-runner-config \
You can’t perform that action at this time.