Skip to content

Instantly share code, notes, and snippets.

View Rbn3D's full-sized avatar

Rubén Vallejo Rbn3D

View GitHub Profile
@RienNeVaPlus
RienNeVaPlus / easing.js
Last active June 2, 2024 08:47 — forked from gre/easing.js
🔀 Simple Easing Functions in JavaScript using `export`
/**
* Easing functions
*
* https://gist.github.com/gre/1650294
* http://easings.net
*/
// no easing, no acceleration
export function easeLinear(t){ return t }
// accelerating from zero velocity
export function easeInQuad(t){ return t*t }
@LordJZ
LordJZ / SpanSplitExtensions.cs
Created August 9, 2018 18:04
Split for Span
using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
public static class SpanSplitExtensions
{
public ref struct Enumerable1<T> where T : IEquatable<T>
{
public Enumerable1(ReadOnlySpan<T> span, T separator)
{
@mardix
mardix / php-cs-fixer-pre-commit.php
Created September 4, 2012 17:06
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@oneillci
oneillci / gist:3205384
Created July 30, 2012 06:45
Using EF Include() with generic repository
public IQueryable<T> FindBy(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes)
{
var query = GetAll().Where(predicate);
return includes.Aggregate(query, (current, includeProperty) => current.Include(includeProperty));
}
// Sample usage
userRepository.FindBy(x => x.Username == username, x.Roles)