Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View biapar's full-sized avatar
🙂

Biagio Paruolo biapar

🙂
View GitHub Profile
@biapar
biapar / fn_remove_accents.sql
Created April 5, 2024 13:00 — forked from jgdoncel/fn_remove_accents.sql
MySQL Function to remove accents and special characters
DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue COLLATE utf8_general_ci;;
-- ACCENTS
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';
@biapar
biapar / FileUploadApiController.cs
Created April 3, 2024 15:46 — forked from robgha01/FileUploadApiController.cs
Using AngularJS API service and Umbraco API controller to permit users to upload files to the server
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@biapar
biapar / countries.json
Created December 4, 2022 16:31 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@biapar
biapar / proxmox-import-disk-image.txt
Created November 7, 2022 19:31 — forked from swuecho/proxmox-import-disk-image.txt
Add import existing disk image into Proxmox
#
# The official PVE docs on how to prepare cloud-init templates:
# https://pve.proxmox.com/wiki/Cloud-Init_Support#_preparing_cloud_init_templates
#
# Additional guides and resources:
# https://dae.me/blog/2340/how-to-add-an-existing-virtual-disk-to-proxmox/
# https://pve.proxmox.com/pve-docs/qm.1.html
# use the Qemu/KVM Virtual Machine Manager to import the disk
qm importdisk 107 Univention-App-kopano-core-KVM.qcow2 local-lvm
@biapar
biapar / JsonController.cs
Created September 15, 2020 06:44 — forked from icavalheiro/JsonController.cs
Umbraco Json controller based on the ContentType renderer. Use this to return the content as a json instead of a view (great for headless mode)
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;
@biapar
biapar / examples.md
Created September 9, 2020 13:54 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@biapar
biapar / examples.md
Created September 9, 2020 13:54 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@biapar
biapar / ClassGenerator.sql
Created May 28, 2020 08:12 — forked from ernado-x/ClassGenerator.sql
Generate C# class from database table
--from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
declare @TableName sysname = 'TableName'
declare @Result varchar(max) = 'public class ' + @TableName + '
{'
select @Result = @Result + '
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
@biapar
biapar / oauth2-restsharp.cs
Created January 26, 2020 21:36 — forked from teocomi/oauth2-restsharp.cs
OAuth2 C# RestSharp
string url = "https://myurl.com";
string client_id = "client_id";
string client_secret = "client_secret";
//request token
var restclient = new RestClient(url);
RestRequest request = new RestRequest("request/oauth") {Method = Method.POST};
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("client_id", client_id);
request.AddParameter("client_secret", client_secret);
@biapar
biapar / RotatePage.xaml.cs
Created December 10, 2019 15:25 — forked from juucustodio/RotatePage.xaml.cs
Example of setting page navigation animations for your Xamarin.Forms applications - http://julianocustodio.com/animationnavigationpage
using FormsControls.Base;
using Xamarin.Forms;
namespace DemoNavigation
{
public partial class RotatePage : ContentPage, IAnimationPage
{
public IPageAnimation PageAnimation { get; } = new RotatePageAnimation
{
Duration = AnimationDuration.Long,