This file contains 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: |
This file contains 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 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 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 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) | |
{ |