Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
DinisCruz / script.coffee
Created January 15, 2015 19:47
script to automatically open swagger ui in chrome
QA_NWR_API = require './TM-QA-NWR-API'
app = require '../../app'
describe.only 'swagger', ->
page = QA_NWR_API.create(before, after)
url = 'http://localhost:8002/'
server = null
before (done)->
describe 'test suite xyz', ->
skip_Tests_If_Offline = (testSuite,next)=>
url = "https://www.google.com"
url.GET (html)=>
if not html
for test in testSuite.tests
test.pending = true
next()
@DinisCruz
DinisCruz / TM-QA-install-script.sh
Last active August 29, 2015 14:19
TM QA install script
#!/bin/sh
if [ ! -f ./TM_4_0_QA ]; then
echo Folder TM_4_0_QA exists so doing a git pull
cd TM_4_0_QA
git pull origin
git submodule update
#ls -l
else
echo Folder TM_4_0_QA does not exists so doing a git pull
git@github.com:TeamMentor/TM_4_0_QA.git
@DinisCruz
DinisCruz / 1 - login.cs
Created April 24, 2015 23:53
StockTrader PoC Scripts (to be executed inside an injected REPL)
var bsl = (ITradeServices)App.BSL;
return bsl.login("uid:1","xxx");
//using Trade.BusinessServiceContract
//using Trade.StockTraderWebApplicationServiceClient
//using StockTrader;
//O2Ref:StockTrader.exe
//O2Ref:PresentationFramework.dll
//O2Ref:PresentationCore.dll
@DinisCruz
DinisCruz / 1. Find-server-network-details.cs
Last active August 29, 2015 14:19
Misc Azure repl scripts
// a) Public IP address
WebClient webClient = new WebClient();
var IP = webClient.DownloadString("http://checkip.dyndns.org/");
return IP; // Current IP Address: 104.45.82.120
//using System.Net;
//b) current hostname
return Dns.GetHostName(); // RD000D3AB0B28A
@DinisCruz
DinisCruz / 1.read-value-from-registry.ps1
Created April 26, 2015 01:18
Misc Azure PowerShell scripts (executed via Kudu)
$regHive = [Microsoft.Win32.RegistryHive]::LocalMachine
$regView = [Microsoft.Win32.RegistryView]::Registry32
$regKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey($regHive, $regView)
$frameworkPath = $regKey.OpenSubKey("SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").GetValue("InstallPath")
$frameworkPath
#returns D:\Windows\Microsoft.NET\Framework\v4.0.30319\
@DinisCruz
DinisCruz / install-ELK.sh
Last active August 29, 2015 14:21
Commands to install elastic search on Vagrant
vagrant init ubuntu/trusty64
vagrant up
vagrant ssh
### inside vagrant SSH
# JDK
sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
# Elastic Search
@DinisCruz
DinisCruz / Webstorm configs.txt
Last active August 29, 2015 14:23
Misc new OSX config - add colors to .bash_profile
File Watcher
CoffeeScript
```
/usr/local/bin/coffee
--output $ProjectFileDir$/.dist/$FileDirRelativeToProjectRoot$/ --compile --map $FileName$
$FileDir$
$ProjectFileDir$/.dist/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.js:$ProjectFileDir$/dist/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.map
@DinisCruz
DinisCruz / Angular 1.4 with Jade with coffee.jade
Created June 26, 2015 00:47
Angular 1.4 with Jade with coffee
doctype html
html(lang="en")
head
meta(charset="utf-8")
title Test
script(src='https://ajax.googleapis.com/ajax/libs/angularjs/1.4.1/angular.js')
script(src='http://coffeescript.org/extras/coffee-script.js')
style.
input { width: 200px }
@DinisCruz
DinisCruz / 1.index.jade
Created July 1, 2015 05:55
PoC of Angular, Jade and CoffeeScript (with auto compile)
extends ../../../TM_Jade/_layouts/page_logged_out.jade
block content
script(src='/angular/js/lib.js')
#application
.row
.col-3
.col-3
div(ng-controller="TestController")