Skip to content

Instantly share code, notes, and snippets.

View praveensewak's full-sized avatar
🎯
Focusing

Praveen praveensewak

🎯
Focusing
View GitHub Profile

.NET Core 3.1 Web Application with NuxtJs

Microsoft.AsNetCore.SpaServices.Extensions

public void ConfigureServices(IServiceCollection services)
{
  services.AddSpaStaticFiles(options => { options.RootPath = "wwwroot"; });
  services.AddControllers();

}

var chinese = [
[0x4e00, 0x9fff], // CJK Unified Ideographs
[0x3400, 0x4dbf], // CJK Unified Ideographs Extension A
[0x20000, 0x2a6df], // CJK Unified Ideographs Extension B
[0x2a700, 0x2b73f], // CJK Unified Ideographs Extension C
[0x2b740, 0x2b81f], // CJK Unified Ideographs Extension D
[0x2b820, 0x2ceaf], // CJK Unified Ideographs Extension E
[0xf900, 0xfaff], // CJK Compatibility Ideographs
[0x3300, 0x33ff], // https://en.wikipedia.org/wiki/CJK_Compatibility
var fs = require('fs')
var cleaner = require('clean-html')
function readFiles(dir, onFileContent, onError) {
fs.readdir(dir, function (err, filenames) {
if (err) {
onError(err)
return
}
filenames.forEach(function (filename) {
{% assign current_variant = product.selected_or_first_available_variant %}
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"@id": "{{ shop.url | append: '/products/' | append: product.handle }}",
"url": "{{ shop.url | append: '/products/' | append: product.handle }}",
"name": "{{ product.title }}",
"image": "{{ product.featured_image.src | img_url: 'master' }}",
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "SiteNavigationElement",
"name": [
"SHOP",
"MATTRESSES",
"FURNITURE",
"ACCESSORIES",
"SLEEP QUIZ",
<script>
/**
* Module to ajaxify all add to cart forms on the page.
*
* Copyright (c) 2015 Caroline Schnapp (11heavens.com)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
@praveensewak
praveensewak / default_fonts.css
Last active September 26, 2018 09:35
Use browser based fonts
html {
font-family: sans serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;
letter-spacing: 0;
font-weight: 400;
@praveensewak
praveensewak / VueHelpers.html
Created December 21, 2016 20:52
VueJs helpers (watchers, debounce)
<!-- Since there is already a rich ecosystem of ajax libraries -->
<!-- and collections of general-purpose utility methods, Vue core -->
<!-- is able to remain small by not reinventing them. This also -->
<!-- gives you the freedom to just use what you're familiar with. -->
<script src="https://unpkg.com/axios@0.12.0/dist/axios.min.js"></script>
<script src="https://unpkg.com/lodash@4.13.1/lodash.min.js"></script>
<script>
var watchExampleVM = new Vue({
el: '#watch-example',
@praveensewak
praveensewak / ControllerTest.cs
Last active September 12, 2016 02:45
Unit Testing Helpers
namespace MvcApplication.Tests.Controllers
{
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MvcApplication.Controllers;
[TestClass]
public class AdminControllerTest
{
IUserService _userService;
@praveensewak
praveensewak / UsefulSqlQueries.sql
Created July 29, 2016 04:47
Useful Sql Queries
-- select maximum user connections for an db instance
SELECT maximum FROM sys.configurations WHERE name='user connections'