Skip to content

Instantly share code, notes, and snippets.

View biapar's full-sized avatar
🙂

Biagio Paruolo biapar

🙂
View GitHub Profile
@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 / gist:9eaf8c2359ea47a77345987f8d489357
Created May 28, 2020 08:13
SQL Server Data Types and Their .NET Framework Equivalents
SQL Server data type CLR data type (SQL Server) CLR data type (.NET Framework)
varbinary SqlBytes, SqlBinary Byte[]
binary SqlBytes, SqlBinary Byte[]
varbinary(1), binary(1) SqlBytes, SqlBinary byte, Byte[]
image None None
varchar None None
char None None
nvarchar(1), nchar(1) SqlChars, SqlString Char, String, Char[]
nvarchar SqlChars, SqlString String, Char[]
@biapar
biapar / ClassGenerator.sql
Created May 28, 2020 08:12
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,
@biapar
biapar / gist:e36b59eeb1a9c19a470ba4ee9baad280
Last active January 26, 2019 15:47
Read Email Subject of Office365 Email Box in C#
using Microsoft.Exchange.WebServices.Data;
using System;
using System.Collections.Generic;
namespace ReadEmail365
{
class Program
{
static void Main(string[] args)
@biapar
biapar / gist:03f3c4b65c823cb47e8877ce9240b66a
Created November 23, 2018 16:54 — forked from warrenbuckley/gist:5685180
Login ActionResult in AuthSurfaceController
/// <summary>
/// Handles the login form when user posts the form/attempts to login
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public ActionResult HandleLogin(LoginViewModel model)
{
if (!ModelState.IsValid)
{
@biapar
biapar / style.css
Created September 6, 2018 19:18
CSS used to customize the Simple Social Icons to match brand color.
/* Simple Social Icons
--------------------------------------------- */
.simple-social-icons li.social-dribbble a {
border: 2px solid #ea4c89 !important;
color: #ea4c89 !important;
}
.simple-social-icons li.social-dribbble a:hover {
background-color: #ea4c89 !important;
@biapar
biapar / gist:3eaa7870b1474f17da0ff27927625de5
Created June 20, 2018 10:10
Example Menu Item in Umbraco
using Umbraco.Core;
using Umbraco.Web;
using Umbraco.Web.Trees;
//https://github.com/marcemarc/uSpinMeRightRound/blob/master/Solution/tooorangey.uSpinMeRightRound/App_Start/RegisterEvents.cs
namespace tooorangey.uSpinMeRightRound.App_Start
{
public class RegisterEvents : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
@biapar
biapar / UmbracoTags.cshtml
Created May 9, 2018 12:25 — forked from amogram/UmbracoTags.cshtml
Using Umbraco Tags in a view
@if (@Model.Content.GetPropertyValue("tags") != null)
{
var tags = Model.Content.GetPropertyValue("tags").TryConvertTo<string>();
string[] tagArray = { };
if (tags.Success)
{
tagArray = tags.Result.Split(',');
}
if (tagArray.Any())