Skip to content

Instantly share code, notes, and snippets.

View HalidCisse's full-sized avatar
🎯
Focusing

Halid Cisse HalidCisse

🎯
Focusing
View GitHub Profile
@HalidCisse
HalidCisse / sdk-cli-update.md
Created January 7, 2021 11:09 — forked from alexeldeib/sdk-cli-update.md
App Insights and Log Analytics SDK + CLI Update

Application Insights Query SDK

The [Microsoft.Azure.ApplicationInsights NuGet package][1] contains the query SDK for App Insights. Here's a bare-minimum setup with a client ready to make calls:

AAD Authentication

using System;
using Microsoft.Azure.ApplicationInsights;
using Microsoft.Rest.Azure.Authentication;
using System.Collections.Generic;
var child_process = require('child_process'),
http = require('http');
url = require('url'),
ffmpeg = null;
var livestream = function (req, resp) {
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var input = 'udp://225.1.1.1:8208';
using System;
using System.Threading.Channels;
using System.Threading.Tasks;
namespace ChannelsAreCool
{
//Disclaimer : I didn't actually run this code so it might not quite work.
//Feel free to complain or ask questions and i'll fix it.
public static class Example
{
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>_www</string>
<key>InitGroups</key>
<true/>
<key>KeepAlive</key>
<true/>
@HalidCisse
HalidCisse / com.startup.plist
Created September 26, 2018 16:25 — forked from codeZoner/com.startup.plist
Launch Demon Start up with Bash Script with MySQL Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Launch Daemon do not always have access to all the path variables
As a results, scripts will sometimes fail if the you are using path variables inside them
To enable the script to have access to all path variables, open up a terminal and type in -->
<!-- echo $PATH -->
<!-- You can opt to filter out some of the path variables which are not required by script-->
<key>EnvironmentVariables</key>
@HalidCisse
HalidCisse / introrx.md
Created June 29, 2018 09:52 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@HalidCisse
HalidCisse / IQueryableExtensions
Created June 13, 2018 23:10 — forked from rionmonster/IQueryableExtensions
Resolve the SQL being executed behind the scenes in Entity Framework Core
public static class IQueryableExtensions
{
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryCompiler");
private static readonly PropertyInfo NodeTypeProviderField = QueryCompilerTypeInfo.DeclaredProperties.Single(x => x.Name == "NodeTypeProvider");
private static readonly MethodInfo CreateQueryParserMethod = QueryCompilerTypeInfo.DeclaredMethods.First(x => x.Name == "CreateQueryParser");
@HalidCisse
HalidCisse / gotcha.md
Created May 5, 2018 15:04 — forked from sheastrickland/gotcha.md
BlockingCollection with Parallel.ForEach with a Partitioner

Lesson Learnt, Streaming Producer / Consumer issue using:

BlockingCollection<T> and Parallel.ForEach(_blockingCollection.GetConsumingEnumerable

Beware default Partitioner algo, which is chunking and buffering.

The GetConsumingPartitioner heading covers it, and also the first comment from Stephen Toub totally nails it. We implemented similar to what commenter Hernan pointed out. Stephen Toub Blog

My absolute saviour, NoBuffering in:

@HalidCisse
HalidCisse / zstd.cs
Created April 1, 2018 00:44 — forked from dimzon/zstd.cs
zstd streaming api wrapper
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
namespace ZstdCompression
{
public static class Zstd
{
@HalidCisse
HalidCisse / command.txt
Created March 26, 2018 18:51 — forked from nrk/command.txt
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"