Skip to content

Instantly share code, notes, and snippets.

@jenyayel
jenyayel / domainsTester.js
Last active October 21, 2016 20:52
Tests a list of domains whether they blocked by proxy or by ISP
// This scripts tests a list of domains whether they blocked by proxy or by ISP
// the tests relies on image object loading and its native events.
// The domains are queued in FIFO and tested one by one until the non-blocked domain found.
//
// usage:
// tester.validateDomains(['//domain1.com', '//domain2.com'], '/favicon.ico')
// .done(function (domain) {
// // one of the domains is OK
// })
// .fail(function () {
@jenyayel
jenyayel / Retry.cs
Created February 11, 2015 13:53
Retry mechanism
using System;
using System.Collections.Generic;
using System.Threading;
namespace RetryPolicy
{
public class Retry
{
/// <summary>
/// Implements simple retry mechanism
@jenyayel
jenyayel / app-pools-recycle.ps1
Created February 11, 2015 13:55
Misc powershells
# recycle all local IIS's application pools
$appPools = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPool"
foreach ($pool in $appPools)
{
trap [Exception] {
Write-Host "ERROR"
continue
}
@jenyayel
jenyayel / .travis.yml
Created November 16, 2015 14:04
Deploy via git
after_success:
- git clone git@heroku.com:qurrus-web-prod.git dist
- gulp build
- gulp bundle
- cd dist
- git config user.name "travis-ci"
- git config user.email "travis-ci@travis-ci.org"
- git add -f *
- cd ../jspm_packages
- git add -f system.js
@jenyayel
jenyayel / pinger.htm
Last active February 2, 2016 13:24
Performs a simple requests for a given Uri on scheduled basis
<!DOCTYPE html>
<html>
<head>
<title>Pinger</title>
</head>
<body>
<a href="#">return back</a>
<hr />
<pre></pre>
<script src="pinger.js"></script>
@jenyayel
jenyayel / build.js
Created January 27, 2016 14:35
per-environment-configuration-in-aurelia
var gulp = require('gulp');
var runSequence = require('run-sequence');
var changed = require('gulp-changed');
var plumber = require('gulp-plumber');
var to5 = require('gulp-babel');
var sourcemaps = require('gulp-sourcemaps');
var paths = require('../paths');
var compilerOptions = require('../babel-options');
var assign = Object.assign || require('object.assign');
var notify = require("gulp-notify");
@jenyayel
jenyayel / bracketsMatchingTest.js
Last active May 4, 2018 09:23
Implement function check (text) which checks whether brackets within text are correctly nested. You need to consider brackets of three kinds: (), [], {}.
var expect = require('expect')
var _matches = {
'{': { invert: '}', isOpening: true },
'}': { invert: '{', isOpening: false },
'(': { invert: ')', isOpening: true },
')': { invert: '(', isOpening: false },
'[': { invert: ']', isOpening: true },
']': { invert: '[', isOpening: false }
};
@jenyayel
jenyayel / OIDC and OAuth2 Flows.md
Created February 2, 2016 17:20 — forked from jawadatgithub/OIDC and OAuth2 Flows.md
Enrich IdentityServer3 Documentation with OIDC (OpenID Connect) and OAuth2 Flows section
Note for community:

A. IdentityServer3 docs, samples and source code use OIDC & OAuth2 terms interchangeably to refer to same thing in many areas. I think that's make sense because OIDC introduced as complement & extension for OAuth2.

B. IdentityServer3, STS, OP, OIDC server, OAuth2 server, CSP, IDP and others: means same thing (software that provide/issue tokens to clients) as explained in [Terminology] (http://identityserver.github.io/Documentation/docs/overview/terminology.html).

C. Grants and flows mean same thing, grant was the common term in OAuth2 specs and flow is the common term in OIDC specs.

D. This document will not focus on custom flow/grant.

E. [Important] Choosing wrong flow leads to security threat.

_showNotification(client, newState, oldState) {
if(!client.subscribed || newState != SENSOR_STATE_FREE)
return false;
this._clearAllAlertsSubscriptions();
let message = {
title: `Restroom available`,
body: `Restroom just become available at floor ${client.floor.replace('floor-', '')} in ${client.area} wing`,
media: '/media/favicon-160x160.png',
timeout: 30000
@jenyayel
jenyayel / .gitignore
Last active November 7, 2016 07:52
OAuth JWT autorenew demo
node_modules
bower_components
.idea
.DS_STORE