Skip to content

Instantly share code, notes, and snippets.

View 16pxdesign's full-sized avatar

Aleksy Ruszala 16pxdesign

View GitHub Profile
@16pxdesign
16pxdesign / LEFT JOIN ON | Using SQL relation to show query
Last active September 28, 2017 11:13
Help-full scripts to quick copy and paste
SELECT c.name, o.product
FROM costumers c
LEFT JOIN orders o
ON c.id = o.costumers_id;
<script>
var text = "Test here";
var rotText = "";
const newLine = '<br>';
rotText = rot13(text);
document.write("Org:" + text + newLine);
document.write("Enc:" + rotText + newLine);
document.write("Dec:" + rot13(rotText) + newLine);
@16pxdesign
16pxdesign / SQL 2.0.sql
Last active April 17, 2019 11:54
Data #tree using #sql
drop table if exists categorytree;
drop table if exists category;
create table category (
id int not null AUTO_INCREMENT,
name varchar (50) not null,
primary key(id)
);
DROP TABLE category CASCADE CONSTRAINTS;
DROP TABLE categorytree CASCADE CONSTRAINTS;
create table category(
id NUMBER GENERATED ALWAYS AS IDENTITY,
name VARCHAR2(50),
PRIMARY KEY(ID)
);
create table categorytree(
@16pxdesign
16pxdesign / Controller.cs
Last active April 19, 2019 13:05
Nested #Form List passing #model in #ASP.NET #ASP.CORE
using System;
using System.Collections.Generic;
using System.Text;
using Application.ViewModels;
using Microsoft.AspNetCore.Mvc;
namespace Application.Controllers
{
public class TestController : Controller
{
@16pxdesign
16pxdesign / css.css
Created April 17, 2019 13:28
air-datepicker only time-picker #picker #boostrap #jquery
.only-timepicker .datepicker--nav,
.only-timepicker .datepicker--content {
display: none;
}
.only-timepicker .datepicker--time {
border-top: none;
}
@16pxdesign
16pxdesign / HomeController.cs
Created April 18, 2019 10:08
Form using #partialviews and #ajax
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Application.Models;
using Microsoft.AspNetCore.Mvc;
namespace Application.Controllers
{
public class HomeController : Controller
@16pxdesign
16pxdesign / HomeController.cs
Last active April 19, 2019 13:04
HomeController FIX
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Application.Models;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace Application.Controllers
$.ajax({
xhr: function () {
var xhr = $.ajaxSettings.xhr();
xhr.upload.onprogress = function (e) {
console.log(Math.floor(e.loaded / e.total * 100) + '%');
};
return xhr;
},
contentType: false,
processData: false,
@helper DisplayTree(List<string> elements) {
}
@DisplayTree(new List<string>());