Skip to content

Instantly share code, notes, and snippets.

@fisshy
fisshy / 1. azure-devops-list-all-variables-in-all-variablegroups.ps1
Last active September 14, 2023 06:14
Lists all defined variables in shared variable groups.
Get-Content "auth.config" | foreach-object -begin {$h=@{}} -process {
$k = [regex]::split($_,'=');
if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) {
$h.Add($k[0], $k[1])
}
}
$username = $h.Get_Item("Username")
$password = $h.Get_Item("Password")
$apiVersion = "7.0"
@fisshy
fisshy / 1. azure-devops-list-all-variables.ps1
Last active September 14, 2023 06:14
List all defined variables for all release pipelines in azure devops
Get-Content "auth.config" | foreach-object -begin {$h=@{}} -process {
$k = [regex]::split($_,'=');
if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) {
$h.Add($k[0], $k[1])
}
}
$username = $h.Get_Item("Username")
$password = $h.Get_Item("Password")
$apiVersion = "6.0"
@fisshy
fisshy / RefreshToken.js
Created December 5, 2018 20:59
Concepts of using redux-observable to refresh token
//Http wrapper
export const post$ = (path, model) => {
return defer(() => {
let headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
};
let accessToken = storage.get().accessToken
@fisshy
fisshy / bitbucket-pipelines.yml
Last active August 26, 2017 11:24
Bitbucket pipline for FTP Publishing.
# This is a sample build configuration for Javascript (Node.js).
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:7.8.0
pipelines:
default:
- step:
@fisshy
fisshy / Startup.Auth
Created February 21, 2015 19:49
JWT Token ASP.NET
public partial class Startup
{
public void ConfigureOAuth(IAppBuilder app)
{
OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
{
#if DEBUG
AllowInsecureHttp = true,
#else
@fisshy
fisshy / httpInterceptor
Created September 14, 2014 11:47
Http Interceptor for Angular JS
angular.module('model').factory('httpMiddletier',
function ($q, $rootScope) {
return {
request: function (config) {
$rootScope.loading = true;
return config || $q.when(config);
},
requestError: function (rejection) {
$rootScope.loading = false;
@fisshy
fisshy / Language.cs
Created May 15, 2014 13:31
Simple Language module for Owin .NET C#
public class LanguageComponent
{
App _next;
//sv-SE
string fallback = ConfigurationManager.AppSettings["language"];
//sv-SE,en-EN etc
string[] accepted = ConfigurationManager.AppSettings["accepted-languages"].Split(',');
@fisshy
fisshy / ng-enter.js
Last active August 29, 2015 14:01
Execute function when pressing enter
angular.module('moduleName')
.directive('ngEnter', function () {
return {
scope: {
ngEnter: '&'
},
link: function ($scope, $element) {
$element.bind("keydown keypress", function (event) {
if (event.which === 13) {
$scope.ngEnter();
@fisshy
fisshy / Based on
Last active October 9, 2016 17:52
Simple image upload to image-shack using node.js
Request your API key here
http://imageshack.us/api_request/
For more information please visist
https://docs.google.com/document/d/16M3qaw27vgwuwXqExo0aIC0nni42OOuWu_OGvpYl7dE/pub
@fisshy
fisshy / dynamic-background-images
Last active December 17, 2015 22:19
dynamic background swapper
A little lib i made for a friend of mine.
Include dynamic-images.css
Include dynamic-images.js
Create the dynamic-images.json on your server ( see the format )
Include setup-dynamic-images.js
Point url to dynamic-images.json that you created on your server.