Skip to content

Instantly share code, notes, and snippets.

View jalchr's full-sized avatar

Jalal EL-SHAER jalchr

  • EdenGate
View GitHub Profile
@jalchr
jalchr / gist:1299665
Created October 19, 2011 21:03
Raven Backup
<target name="BackupRavenDb">
<exec program="Raven.Backup" basedir="${BackupToolPath}" pidproperty="batch1.pid" spawn="true" >
<arg value="--url=http://localhost:8080" />
<arg value="--dest=${tempDirectory}${databaseName}" />
</exec>
<waitforexit pid="${batch1.pid}" />
<zip zipfile="${tempDirectory}${databaseName}.zip">
<fileset basedir="${tempDirectory}${databaseName}">
<include name="*.*" />
</fileset>
@jalchr
jalchr / gist:1528815
Created December 28, 2011 17:35
SpecFor Sample
[Given(typeof(the_entity_is_available))]
public class When_entity_is_on_hold : SpecsFor<Entity>
{
public When_entity_is_on_hold(Type[] contexts) : base(contexts) { }
protected override void InitializeClassUnderTest()
{
SUT = new Shared().CreateEntity();
}
@jalchr
jalchr / Raven_2544_Bug
Created April 1, 2013 15:13
RavenDb v.2544 A bug in the deserialization model ... somehow related to the way we name objects....
using System;
using System.Collections.Generic;
namespace RavenApp
{
using System.Linq;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Indexes;
@jalchr
jalchr / RavenDb_ResultTransformers_Bug
Created April 3, 2013 21:40
Another bug in RavenDb
using System;
using System.Collections.Generic;
namespace RavenApp
{
using System.Linq;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Indexes;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Analysis.Tokenattributes;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Indexes;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Analysis.Tokenattributes;
using Lucene.Net.Util;
using Raven.Abstractions.Indexing;
using Raven.Client.Linq;
using Raven.Database.Indexing;
@jalchr
jalchr / gist:589c6d492d0676ff774e
Created March 20, 2016 21:49
copy all nodes from one database to another
public void dumpAndLoadTo(String targetPath) throws IOException, InterruptedException {
// I first tried something like this:
// neo4j-shell -path outDir -c "DUMP MATCH n RETURN n;" | neo4j-shell -path targetPath -file -
// but performance was horrible upon import.
// See http://stackoverflow.com/questions/28246416/neo4j-export-import-data .
logger.info("Loading to db " + targetPath);
GraphDatabaseService dbSrc = getDb();
GraphDatabaseService dbDest = getDb(targetPath);
@jalchr
jalchr / Expo_Push_Notifications_Helper.cs
Created May 11, 2019 08:48 — forked from danparker276/Expo_Push_Notifications_Helper.cs
Expo.io Push Notifications Send Through C#
public class ExpoPushHelper
{
public class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request = base.GetWebRequest(address) as HttpWebRequest;
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
return request;
}