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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dumber Gist</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> | |
<base href="/"> | |
</head> | |
<!-- | |
Dumber Gist uses dumber bundler, the default bundle file |
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.Linq; | |
namespace Extensions | |
{ | |
/// <summary> | |
/// Allow the up to the first eight elements of an array to take part in C# 7's destructuring syntax. | |
/// </summary> | |
/// <example> | |
/// (int first, _, int middle, _, int[] rest) = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dumber Gist</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> | |
<base href="/"> | |
</head> | |
<!-- | |
Dumber Gist uses dumber bundler, the default bundle file |
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 postcss = require('postcss') | |
module.exports = { | |
theme: { | |
extend: {} | |
}, | |
variants: { | |
float: ['responsive', 'rtl'], | |
margin: ['responsive', 'rtl'], | |
padding: ['responsive', 'rtl'], |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dumber Gist</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> | |
<base href="/"> | |
</head> | |
<!-- | |
Dumber Gist uses dumber bundler, the default bundle file |
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 scrollUp(start?: Function, end?: Function) { | |
const el = (document.documentElement || document.body); | |
if (start) start(); | |
el.scroll({ | |
top: 0, | |
left: 0, | |
behavior: 'smooth' | |
}); | |
if (end) end(); | |
} |
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
import { injectStyle } from 'styl-injector'; | |
const rippleStyleObj = { | |
"[data-animation]": { position: "relative", overflow: "hidden" }, | |
".ripple": { | |
width: "2px", | |
height: "2px", | |
position: "absolute", | |
borderRadius: "50%", | |
backgroundColor: "rgba(255, 255, 255, 0.5)", |
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
public abstract class Entity | |
{ | |
public long Id { get; set; } | |
[SuppressMessage("ReSharper", "BaseObjectGetHashCodeCallInGetHashCode")] | |
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] | |
public override int GetHashCode() | |
{ | |
if (IsTransient()) | |
return base.GetHashCode(); |
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; | |
namespace Dummy | |
{ | |
class Program | |
{ | |
private static void Header(string title) | |
{ | |
Console.WriteLine(new string('=', 79)); | |
Console.WriteLine(title); |
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
//Shoutout to MBoros on stackoverflow | |
public static class ExpressionCombiner { | |
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> exp, Expression<Func<T, bool>> newExp) | |
{ | |
// get the visitor | |
var visitor = new ParameterUpdateVisitor(newExp.Parameters.First(), exp.Parameters.First()); | |
// replace the parameter in the expression just created | |
newExp = visitor.Visit(newExp) as Expression<Func<T, bool>>; | |
// now you can and together the two expressions |