Skip to content

Instantly share code, notes, and snippets.

View sjkp's full-sized avatar

Simon J.K. Pedersen sjkp

View GitHub Profile
@lelandrichardson
lelandrichardson / ko-convenience.js
Created March 5, 2014 01:11
Knockout.js Custom Utility Bindings
(function (ko, handlers, unwrap, extend) {
"use strict";
extend(handlers, {
href: {
update: function (element, valueAccessor) {
handlers.attr.update(element, function () {
return { href: valueAccessor() };
});
}
},
@premchandpl
premchandpl / CompleteFunction.js
Last active August 29, 2015 14:02
Complete Code Snippet
that.getData = function (listName, xmlQuery, contentType, onGetSuccess) {
var objClientCtx = new SP.ClientContext.get_current();
if (objClientCtx) {
var oWeb = objClientCtx.get_web();
var oList = oWeb.get_lists().getByTitle(listName);
var query = new SP.CamlQuery();
query.set_viewXml(xmlQuery);
var objlistItems = oList.getItems(query);
objClientCtx.load(objlistItems);
objClientCtx.executeQueryAsync(function (sender, args) {
@mtmk
mtmk / LuceneNetExample.cs
Last active April 3, 2024 12:47
Quick and complete Lucene.Net example
using System;
using System.Globalization;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Version = Lucene.Net.Util.Version;
namespace SInnovations.VSTeamServices.TasksBuilder.KeyVault.ResourceTypes
{
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using CommandLine;
using SInnovations.VSTeamServices.TasksBuilder.Attributes;
using SInnovations.VSTeamServices.TasksBuilder.ResourceTypes;
@maxvt
maxvt / infra-secret-management-overview.md
Last active February 3, 2025 06:11
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@pksorensen
pksorensen / OauthBroker.ps
Last active June 10, 2016 18:02
Example C# task, the task.json is generated when run with --build argument. (Can be done as part of build step).
[CmdletBinding(DefaultParameterSetName = 'None')]
param
(
[String] [Parameter(Mandatory = $true)]
$ConnectedServiceName,
[String] [Parameter(Mandatory = $false)]
$KeyVaultName,
[String] [Parameter(Mandatory = $false)]
$SecretName,
[String] [Parameter(Mandatory = $false)]
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active April 17, 2025 11:09
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@gbellmann
gbellmann / My404Filter.cs
Created January 29, 2017 17:47
Telemetry processor to ignore certain 404 errors in Application Insights
using System;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
namespace Samples
{
public class My404Filter : ITelemetryProcessor
{
private ITelemetryProcessor Next { get; set; }
@tiantuxu
tiantuxu / ffmpeg-common.sh
Last active March 17, 2025 11:22
Common ffmpeg Command Lines (with NVIDIA GPU Support)
# Decode a video to yuv420 raw format
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p -f null /dev/null
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p output.yuv
# Resize videos to 640x480
ffmpeg -c:v h264_cuvid -i input.mp4 -vf scale=640:480 -c:v h264_nvenc output.mp4
# Downsampling frame rate to 30fps
ffmpeg -i input.mp4 -r 30 -c:v h264_nvenc output.mp4
{
"name": "CreateCertificate",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2016-09-01",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat('https://management.dotnetdevops.org/providers/DotNetDevOps.AzureTemplates/templates/KeyVault/certificates/demo?secretName=test&keyVaultName=',reference('DeployKeyvault').outputs.keyVaultName.value)]",
"contentVersion": "1.0.0.0"
},