Skip to content

Instantly share code, notes, and snippets.

View singhshashi's full-sized avatar
🎯
Focusing

Shashi Shekhar Singh singhshashi

🎯
Focusing
View GitHub Profile
@singhshashi
singhshashi / index.html
Created August 6, 2021 14:08
Electron fiddle
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@singhshashi
singhshashi / pouchDBElectron.js
Last active July 6, 2016 19:09
Configuring PouchDB with LevelDB to store data within User's Home folder
//When using pouchDB within your Electron app, you may want to use different locations for the DB file during development vs releasing the app.
//When distributing the app, you would want to store the data within the $HOME/.config/YourApp/data as per convention on Ubuntu.
//to access the environment variable HOME in the renderer process. See https://github.com/electron/electron/issues/3306
const remote = require('electron').remote;
//we cannot use ~ in the path of leveldb as that is not correct way. See https://github.com/Level/levelup/issues/120. Thus use env.HOME
let dbFilePath = remote.process.env.HOME + '/.config/myapp/data/';
if (process.env.NODE_ENV === 'development') {
dbFilePath = './data/';
}
using System;
using System.Linq.Expressions;
using System.Reflection;
using WebApi.Delta;
namespace Hst.Deals.API.Infrastructure
{
internal class CompiledPropertyAccessor<TEntityType> : PropertyAccessor<TEntityType> where TEntityType : class
{
private Action<TEntityType, object> _setter;