This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dotnet-script | |
/* | |
You will need dotnet core and "dotnet tool install -g dotnet-script" | |
*/ | |
using System; | |
using System.IO; | |
var files = Directory.GetFiles("./", "._*", SearchOption.AllDirectories); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let fs = require('fs'); | |
let path = require('path'); | |
const pathToIndexFile = 'public/index.html'; | |
module.exports = async ctx => { | |
let indexPath = path.resolve(pathToIndexFile); | |
ctx.status = 200; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const notifier = require('node-notifier'); | |
const parcel = require('parcel-bundler'); | |
const shell = require('shelljs'); | |
function notifyError(err) { | |
notifier.notify({ | |
title: 'Gulp detect an error', | |
message: 'Something broke! Please check console for logs!' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Hapi = require('@hapi/hapi') | |
const index = require('./endpoints/index') | |
const teste = require('./endpoints/teste') | |
let server = Hapi.server({ | |
port: 3000, | |
host: 'localhost' | |
}) | |
let port = 3000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT CONNECT | |
ON DATABASE database_name | |
TO user_name; | |
GRANT SELECT /*, INSERT, UPDATE, DELETE */ | |
ON ALL TABLES IN SCHEMA public | |
TO user_name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dotnet add package MySql.Data.EntityFrameworkCore | |
# dotnet add package Microsoft.EntityFrameworkCore.Design | |
# dotnet tool install --global dotnet-ef --version 3.0.0-* | |
dotnet ef dbcontext scaffold "server=localhost;port=3306;user=root;password=mypass;database=databasename" MySql.Data.EntityFrameworkCore -o Database -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Umbraco.Core.Composing; | |
using Umbraco.Web; | |
using Umbraco.Web.Dashboards; | |
using Umbraco.Web.Sections; | |
namespace YOUR_PROJECT_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System; | |
using System.Net; | |
using System.Web; | |
using System.Web.Mvc; | |
using Umbraco.Core.Models; | |
using Umbraco.Core.Models.PublishedContent; | |
using Umbraco.Web.Models; | |
using Umbraco.Web.Mvc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using Umbraco.Core.Models.PublishedContent; | |
using Umbraco.Web.Mvc; | |
namespace YOUR_APP_NAME.Controllers | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getTouch(event) { | |
if (event.touches) return event.touches[0] | |
return event; | |
} | |
function addSwipeListener(element, callback, startCallback, finishCallback) { | |
let y; | |
let handleTouchStart = (event) => { | |
y = getTouch(event).clientY; |
OlderNewer