Skip to content

Instantly share code, notes, and snippets.


Mouad Cherkaoui mouadcherkaoui

View GitHub Profile

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

View MapppingAttributes.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PresenterMapperDto.Attributes
[System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public sealed class MapToEntityAttribute : Attribute
View UIHelper.cs
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace Hardcodet.Wpf.Util
/// <summary>
/// Helper methods for UI-related tasks.
/// </summary>
public static class TreeHelper
mouadcherkaoui / AppDataContext.csx
Last active Mar 22, 2020
Example of using EntityFramework in Azure Functions
View AppDataContext.csx
#load "member.csx"
using System.Data.Entity;
using Microsoft.Azure;
public class AppContext: DbContext {
public static string connectionString = CloudConfigurationManager.GetSetting("SqlAzureConnectionString");
// we should have an appSetting named SqlAzureConnectionString
// or simply use it in connectionStrings section and use this method
// ConfigurationManager.ConnectionStrings["ConnectStringToUse"].ConnectionString
View deploy.json
"$schema": "",
"contentVersion": "",
"parameters": {
"functionAppName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wish to create."
mouadcherkaoui / Guid.ts
Created Dec 12, 2018 — forked from emptyother/Guid.ts
GUID class for Typescript
View Guid.ts
class Guid {
public static newGuid(): Guid {
return new Guid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = Math.random() * 16 | 0;
const v = (c == 'x') ? r : (r & 0x3 | 0x8);
return v.toString(16);
public static get empty(): string {
return '00000000-0000-0000-0000-000000000000';
mouadcherkaoui / ViewModelBase.cs
Created Apr 6, 2019 — forked from mariodivece/ViewModelBase.cs
A simple ViewModelBase for WPF Apps
View ViewModelBase.cs
namespace Unosquare.Wpf
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
public abstract class ViewModelBase : INotifyPropertyChanged
// uncomment the line below for Log4Net Logging
View a.cs
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using ObjectDumper;
using Xunit;
namespace Classdynamic.BK5
mouadcherkaoui / Struct.ps1
Created Apr 12, 2019 — forked from proxb/Struct.ps1
Using PowerShell and Reflection to dynamically build a Struct with Constructors and Methods
View Struct.ps1
#region Module Builder
$Domain = [AppDomain]::CurrentDomain
$DynAssembly = New-Object System.Reflection.AssemblyName(([guid]::NewGuid().ToString()))
$AssemblyBuilder = $Domain.DefineDynamicAssembly($DynAssembly, [System.Reflection.Emit.AssemblyBuilderAccess]::Run) # Only run in memory
$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(([guid]::NewGuid().ToString()), $False)
#endregion Module Builder
#region STRUCTs
#Order of creating these Structs is important
#region MyStruct
$Attributes = 'AutoLayout, AnsiClass, Class, Public, SequentialLayout, Sealed, BeforeFieldInit'
View fluentapi-interfaces.cs
public interface IFluentApiDefinition
IFluentEndpoint HasEndpointUri(string endpoint);
public interface IFluentEndpoint
IWithVersion OfVersion(string apiVersion);