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
/* | |
jQuery to select all the values of the last column of 17 rows of an html table, where there are 8 columns. The values are actually anchor tags, which contain img tags. Extract the src attribute from those tags. | |
In the resulting JavaScript, also import jQuery via dynamically adding it to the page within the javascript, not via a script tag | |
*/ | |
// Dynamically add jQuery to the page | |
let script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'https://code.jquery.com/jquery-3.6.0.min.js'; | |
document.head.appendChild(script); |
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 void BMPtoNV12(byte[] yuv420sp, byte[] argb, int width, int height) | |
{ | |
int frameSize = width * height; | |
int yIndex = 0; | |
int uvIndex = frameSize; | |
uint a; | |
int R, G, B, Y, U, V; |
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
/// <summary> | |
/// Transform NV12 to bmp image so we can view how is it looks like. Note it's not NV12 to RBG conversion. | |
/// </summary> | |
/// <param name="data">NV12 sample data.</param> | |
/// <param name="width">Image width.</param> | |
/// <param name="height">Image height.</param> | |
/// <param name="logger">Log instance.</param> | |
/// <returns>The <see cref="Bitmap"/>.</returns> | |
public static Bitmap TransformNv12ToBmpFaster(byte[] data, int width, int height, IGraphLogger logger) | |
{ |
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
function ImageToBase64 { | |
Param([String]$path) | |
[bool]$valid = ($path -ne "") | |
if ($valid) { | |
[String[]]$elements = $path.split(".") | |
[int]$max = $elements.Count - 1 | |
[String]$ext = $elements[$max] | |
[String]$uri = "data:image/$($ext);base64," | |
$elements[$max] = "txt" |
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 logging | |
import gkeepapi | |
import jsonpickle | |
import os | |
import azure.functions as func | |
class KeepNote(object): | |
label = "" | |
text = "" | |
category = "" |
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; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Logging; |
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.Net; | |
using System.Net.Sockets; | |
using System.Threading.Tasks; | |
namespace ListenOnAny | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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.ComponentModel.DataAnnotations; | |
using System.Runtime.Serialization; | |
using System.Text; | |
namespace TSharkConsumer | |
{ | |
[System.Runtime.Serialization.DataContractAttribute(Name = "SMPPMessage", | |
Namespace = "http://schemas.datacontract.org/2004/07/teleios.messaging.smpp.Models")] |
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 Tuple<string,string> SetState(string state) | |
{ | |
var vmName = VirtualMachineName; | |
var client = AzureClientId; | |
var key = AzureClientKey; | |
var tenant = AzureTenantId; | |
var creds = new AzureCredentialsFactory() | |
.FromServicePrincipal(client, key, tenant, AzureEnvironment.AzureGlobalCloud); | |
var subscriptionId = AzureSubscriptionId; | |
var azure = Microsoft.Azure.Management.Fluent.Azure.Authenticate(creds).WithSubscription(subscriptionId); |
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
[FunctionName("GoogleActions")] | |
public static IActionResult Run( | |
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, | |
[Queue("changevmstate")] out string state, | |
ILogger log) | |
{ | |
state = null; | |
try |
NewerOlder