Skip to content

Instantly share code, notes, and snippets.

View ismailmayat's full-sized avatar

Ismail Mayat ismailmayat

View GitHub Profile
@ismailmayat
ismailmayat / mongo_delete
Last active March 24, 2020 12:53
Mongo delete from array
{
"companyName": "LinkedIn",
"managedBy": {
"name": "Novicel agency",
"email": "novicell@admin.com",
"umbracoMemberId": 1052,
"umbracoMemberGuidId": "d5e2ec1b-44d8-4a71-806f-fc5a3f252e98",
"agency": "Agency",
"agencyId": 1051
},
double totalDocuments = _collection.CountDocuments(predicate);
total = totalDocuments;
var pagedIems = _collection.Find(predicate).Skip(pageNo*pageSize).Limit(pageSize).ToList();
public class AsciiFoldingFilter
{
private readonly Analyzer _analyzer;
// We are analyzing the query before adding the wildcards
// This way the words containg diactrics (characters specific to a language)
// will be folded to ASCII character set.
// e.g. word "weiß Glückwunsch" will be flattened into "weiss gluckwunsch"
//
// When the wildcards are added before analyzing, then the text will not be analyzed
// https://issues.apache.org/jira/browse/LUCENENET-486
using System;
using System.Globalization;
using Lucene.Net.Documents;
using System.Text;
using Examine;
using Umbraco.Core;
using Umbraco.Core.Logging;
using UmbracoExamine;
namespace BusinessLogic.Events
using HtmlAgilityPack;
using System;
using System.Linq;
using System.Net;
using System.Text;
using Umbraco.Core.Logging;
namespace Application.BusinessLogic.Services
{
public interface IWebScraper
@ismailmayat
ismailmayat / CogCoin.sol
Created February 24, 2018 17:13 — forked from anonymous/CogCoin.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.20+commit.3155dd80.js&optimize=false&gist=
pragma solidity ^0.4.0;
import './Ownable.sol';
contract CogCoin is Ownable {
string coinName;
string coinSymbol;
uint256 public totalSupply;
uint256 public dailyTransferLimit;
mapping (address => uint256) public wallets;
@ismailmayat
ismailmayat / MaxDocs.cs
Created December 4, 2017 16:50
Code to get all docs in lucene when using examine
private int MaxDocs()
{
BaseSearchProvider searcher = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
var baseSeacher = (LuceneSearcher) _searcher;
var folder = baseSeacher.LuceneIndexFolder;
var fsDir = FSDirectory.Open(folder);
var reader = IndexReader.Open(fsDir, true);
int maxDocCount = reader.NumDocs();
public class AsciiFoldingFilter
{
private readonly Analyzer _analyzer;
// We are analyzing the query before adding the wildcards
// This way the words containg diactrics (characters specific to a language)
// will be folded to ASCII character set.
// e.g. word "weiß Glückwunsch" will be flattened into "weiss gluckwunsch"
//
// When the wildcards are added before analyzing, then the text will not be analyzed
// https://issues.apache.org/jira/browse/LUCENENET-486
@ismailmayat
ismailmayat / Init.cs
Created November 13, 2017 17:36
document writing event
using System.Collections.Generic;
using System.Globalization;
using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
using ExamineContrib.Spatial.Model;
using Lucene.Net.Documents;
using Lucene.Net.Spatial.Tier.Projectors;
using Lucene.Net.Util;
using Umbraco.Core;