This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Aurelia 2 Autoinject Webpack Transformer | |
Have you improved it? Please share! | |
https://gist.github.com/migajek/adaa1e56a03f913f18aee05bc12c2e09 | |
Aurelia 2 beta 15 implemented TC 39 decorators, which currently doesn't support emitting metadata. | |
This forces developers to explicitly decorate class with @inject(Dep1, Dep2) | |
this code is a very limited transformer that handles the issue for MY codebase, and therefore might not work properly for your :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace MemTestPlain | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HangfireConsoleLogger: ILogger | |
{ | |
private class AsyncLocalScope : IDisposable | |
{ | |
public AsyncLocalScope(PerformContext context) => PerformContext.Value = context; | |
public void Dispose() => PerformContext.Value = null; | |
} | |
private static readonly AsyncLocal<PerformContext> PerformContext = new AsyncLocal<PerformContext>(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
factory('sse', ['$rootScope', '$http', function($rootScope, $http) { | |
// https://gist.github.com/migajek | |
var splitOnFirst = function (s, c) { if (!s) return [s]; var pos = s.indexOf(c); return pos >= 0 ? [s.substring(0, pos), s.substring(pos + 1)] : [s]; }; | |
return { | |
start: function(handlers) { | |
var opt = {}; | |
var sse = new EventSource('/event-stream'); | |
sse.addEventListener('message', function(e) { | |
var parts = splitOnFirst(e.data, ' '); | |
var selector = parts[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import re | |
class AngularPromptDepsCommand(sublime_plugin.WindowCommand): | |
def run(self): | |
defstr = "" | |
if self.window.active_view(): | |
cmd = AngularInjectGetDepsCommand(view = self.window.active_view()) | |
result = cmd.run(None) | |
if result: |