Skip to content

Instantly share code, notes, and snippets.

View HTTPPostCachingPolicy.xml
<!-- Custom caching policy for on HTTP POST for Azure API Management:
1. Policy looks in the Request body - 'cacheKey' property which then used as cache key.
Expected values are: <null>, ALL or NOEXPIRED
Defaults to ALL in case <null>
2. Cache expiration set to 60 seconds/1 minute
<base />
View knockoutExtensions.js
* read-only date display with momentjs
* use like this: data-bind="moment: dateVar, format: 'YYYY-MM-DD'"
* The "format" is optional and will default to "MM/DD/YYYY"
ko.bindingHandlers.moment = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var val = valueAccessor();
var date = moment(ko.utils.unwrapObservable(val));
View gist:5592001
#include <stdio.h>
int main (void)
int num,cont;
scanf("%d", &num);
for(cont = 2;(cont < num) && (num%cont!=0); cont++){
View linq.cs
var dados = (from p in db.t0010_bairro
where p.t0001_cod_cidade == pCodCidade
select (int?)p.t0010_cod_bairro).Max() ?? 1;