Skip to content

Instantly share code, notes, and snippets.

View omercs's full-sized avatar
😃
What's up?

Omer Cansizoglu omercs

😃
What's up?
  • Snapchat
  • Seattle, WA
View GitHub Profile
@omercs
omercs / Oauth2AzureActiveDirectoryRuby
Last active March 2, 2021 12:21
Oauth2 token from Azure Active Directory in Ruby on Rails project
require 'oauth2'
class WelcomeController < ApplicationController
# You need to configure a tenant at Azure Active Directory(AAD) to register web app and web service app
# You will need two entries for these app at the AAD portal
# You will put clientid and clientsecret for your web app here
# ResourceId is the webservice that you registered
# RedirectUri is registered for your web app
CLIENT_ID = 'b6a42...'
CLIENT_SECRET = 'TSbx..'
@omercs
omercs / travis_trigger_build
Created February 25, 2014 22:39
Travis CI is open source continuous integration for many languages. It sometimes fails if it does not open emulator or similar. It has API to trigger builds and do some queries. Following example shows how to trigger last build, if it has an error. You can run this script as a scheduled task.
To run this:
Install node.js first
Npm install travis-ci
Node trigger_for_me.js
Put this into trigger_for_me.js
var Travis = require('travis-ci');
var travis = new Travis({
version: '2.0.0'