Skip to content

Instantly share code, notes, and snippets.

View mouadcherkaoui's full-sized avatar
🎯
Focusing

Mouad Cherkaoui mouadcherkaoui

🎯
Focusing
View GitHub Profile
@craigvantonder
craigvantonder / electron-sqlite3.md
Last active October 16, 2022 05:47
Electron SQLite3 Integration

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:

@pirpyn
pirpyn / mount_usb.sh
Created February 24, 2020 13:43
Automatic USB drive mounting in WSL
#!/bin/bash -e
# Small script to automatically mount/unmount USB drive in WSL
usage() {
cat << EOF
usage: $(basename $0) [-h] [-l] [-u|-m]
Options:
-h
Show this message
@jmangelo
jmangelo / AppConfig.Transformation.targets
Created February 25, 2011 22:40
VS 2010 SP1 BETA - MSBuild Project file for App.config XML transformations.
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- 20110225 : João Angelo : Compatibility fix for Visual Studio SP1 Beta -->
<!-- 20110224 : Ryan Milligan : Created OverrideAppConfigWithTargetPath target to fix ClickOnce deploy bug -->
<!-- 20100827 : João Angelo : Fixed bug when using Publish command within Visual Studio -->
<PropertyGroup>
<!-- Prevent circular dependency on Build target -->
<PipelineDependsOnBuild>false</PipelineDependsOnBuild>
<!-- Override project config file name (By default is set to Web.config) -->
<ProjectConfigFileName>App.Config</ProjectConfigFileName>
@emptyother
emptyother / Guid.ts
Last active July 4, 2023 21:00
GUID class for Typescript
class Guid {
public static newGuid(): Guid {
return new Guid(crypto.randomUUID());
// Old IE supported way:
/*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);
}));*/
@miteshsureja
miteshsureja / Program.cs
Last active July 5, 2023 12:27
How to execute PowerShell script or cmdlets from C# code?
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System;
using System.Collections.Specialized;
using System.ComponentModel;
namespace ThomasJaworski.ComponentModel
{
public abstract class ChangeListener : INotifyPropertyChanged, IDisposable
{
#region *** Members ***
protected string _propertyName;
Get-PnpDevice -FriendlyName *webcam*
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId
@nikhita
nikhita / install-firacode.sh
Created April 24, 2017 17:32
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
@lewebsimple
lewebsimple / nuxtjs-nestjs.md
Last active January 19, 2024 16:14
NuxtJS / NestJS fullstack development

This is my take on fullstack development using NuxtJS and NestJS.

Development steps

  • Lerna monorepo
  • TypeScript linting and formatting
  • Minimal NestJS server
  • Minimal NuxtJS client
  • Environment configuration
  • TypeGraphQL
  • TypeORM / MySQL
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.