Skip to content

Instantly share code, notes, and snippets.

View vjrantal's full-sized avatar

Ville Rantala vjrantal

  • Microsoft
  • Finland
View GitHub Profile
@vjrantal
vjrantal / karma.conf.js
Created February 5, 2015 11:49
WebDriver configuration example to run angular-seed tests on Windows Phone
diff --git a/karma.conf.js b/karma.conf.js
index 44bb29f..8d47576 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -15,11 +15,28 @@ module.exports = function(config){
frameworks: ['jasmine'],
- browsers : ['Chrome'],
+ hostname: '10.0.1.2',
@vjrantal
vjrantal / npm-run-protractor
Last active August 29, 2015 14:14
WebDriver example run output of angular-seed tests on Windows Phone
$ npm run protractor
> angular-seed@0.0.0 preprotractor /Users/vjrantal/Software/angular-seed
> npm run update-webdriver
> angular-seed@0.0.0 preupdate-webdriver /Users/vjrantal/Software/angular-seed
> npm install
npm WARN package.json karma-firefox-launcher@0.1.4 No README data
@vjrantal
vjrantal / plugin.xml
Last active August 29, 2015 14:16
Clips from a plugin.xml file
<!-- Top level plugin element omitted -->
<engines>
<engine name="cordova" version=">=3.1.0" />
<engine name="cordova-windows8" version=">=3.8.0" />
</engines>
<js-module src="www/AllJoyn.js" name="AllJoyn">
<clobbers target="AllJoyn" />
</js-module>
@vjrantal
vjrantal / output.txt
Created March 13, 2015 11:52
Output from a cordova-parametic run when using the wp8 platform
C:\Users\vjrantal\Software\cordova-paramedic>npm run test-wp8
> cordova-paramedic@0.0.8 test-wp8 C:\Users\vjrantal\Software\cordova-paramedic
> node main.js --platform wp8 --plugin ../spec/testable-plugin/
cordova-paramedic :: checking cordova version
4.3.0
cordova-paramedic :: creating temp project
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "C:\Users\vjrantal\Software\cordova-paramedic\tmp"
cordova-paramedic :: installing ../spec/testable-plugin/
@vjrantal
vjrantal / function.json
Last active August 29, 2017 05:23
Streaming Node.js function
{
"bindings": [
{
"type": "blobTrigger",
"name": "input",
"direction": "in",
"dataType": "stream",
"path": "test-input-node/{name}"
},
{
@vjrantal
vjrantal / adx.csl
Last active May 16, 2019 05:42
Update policy sample to expand JSON arrays (note that below payload sample could also be ingested directly using multijson format - see multijson.csl)
// Create staging table that holds the JSON data as it comes via the Event Hubs.
// If the staging table is not needed, a zero retention policy can be set using:
// https://docs.microsoft.com/en-us/azure/kusto/management/retention-policy#alter-retention-policy
.create table Staging (Data: dynamic)
// Create the table for the expanded messages. See here for an example what kind of input
// could be mapped to a table like this:
// https://gist.github.com/vjrantal/29cd4881a9f65ad803daadabd56c1f68#file-payload-json
.create table Messages (ApplicationUri: string, DisplayName: string, Value: real, NodeId: string, SourceTimestamp: datetime)
import os
def test_function():
if os.environ.get('SOMETHING_THAT_DOES_NOT_EXIST'):
tail = ''
if tail:
print('Not printed')
test_function()
@vjrantal
vjrantal / output.sh
Created August 2, 2019 09:07
python3.5 command removed from python:3.7.4 image
$ sudo docker run -it python:3.7.3 /bin/bash
Digest: sha256:9e0b4f32487ca1863b45383420b8db77990debae748e2e875d2f86fa9510d4a5
Status: Downloaded newer image for python:3.7.3
root@b669a8b8fe51:/# python3.5
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ sudo docker run -it python:3.7.4 /bin/bash
@vjrantal
vjrantal / permissions-for-default-service-account.yaml
Created August 6, 2019 10:02
Configuration of a privileged role and role binding that allows a test application in a CI to run
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: privileged-role
rules:
- apiGroups: [""]
resources: ["secrets", "pods", "pods/log", "services"]
verbs: ["get", "watch", "list", "create", "delete"]
- apiGroups: ["batch"]
resources: ["jobs"]