Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mouad Cherkaoui mouadcherkaoui

🎯
Focusing
View GitHub Profile
View electron-sqlite3.md

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
View deploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionAppName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wish to create."
}
},
@mouadcherkaoui
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
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
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);
View CodeExamples.cs
private const string subscriptionKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //your-subscription-key;
private const string _endpoint =
"https://westus.api.cognitive.microsoft.com/face/v1.0/detect";
private const string localImagePath = @"Images/image.jpg";
private const string remoteImageUrl =
"http://images5.fanpop.com/image/photos/26900000/Nicolas-Cage-nicolas-cage-26969804-2069-2560.jpg";