Skip to content

Instantly share code, notes, and snippets.

View andreinitescu's full-sized avatar

Andrei Nitescu andreinitescu

View GitHub Profile
@jonathantneal
jonathantneal / README.md
Created November 15, 2016 23:51
A demonstration of how simple it is to create a local server in Node

Simple Node Server

A demonstration of how simple it is to create a local server in Node.

This barebones example is here to help you understand how you could serve a simple static directory as a local site.

Usage

node .
@wojteklu
wojteklu / clean_code.md
Last active July 30, 2025 04:01
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@nikolasleblanc
nikolasleblanc / gist:b7680bfa8aa007fd84ffc8a32db613ea
Last active August 23, 2016 17:35
Upgrading to webpack 2
## package.json changes
"webpack": "^2.1.0-beta.20",
"typescript": "^2.0.0",
"webpack-dev-server": "^2.1.0-beta.0",
"webpack-hot-middleware": "^2.12.2",
"webpack-split-by-path": "^0.1.0-beta.1", <-- struggles, I've removed it
https://github.com/BohdanTkachenko/webpack-split-by-path/pull/22#issuecomment-240050461
@yleflour
yleflour / wallaby.js
Last active July 13, 2024 17:29
Wallaby + React Native
/*
WallabyJS React Native Config
Works well with Jest + Enzyme
*/
/* eslint-disable */
module.exports = function (wallaby) {
return {
files: [
'src/**/*.js',
@deanrad
deanrad / redux-distilled.md
Last active December 27, 2020 18:31
TL;DR Better Redux involves using maps of action types to reducers, not switch/case statements

Distilling the Essence of Reducers

Redux has brought the notion of reducer back into the awareness of many developers for whom they are a novel concept. In fact they are quite simple, and used all the time in such things as SUM aggregations in databases, where they compute a single value from many.

It's great that Redux has made reducers known to a broader audience, though they are relatively ancient concepts in programming, in fact. But the particular way Redux illustrates a reducer in its documentaion is, in my opinion, with a coding style that is harder to extend and read than it should be. Let's distill reducers down to their essensce, and build up Redux reducers in a way that lowers complexity, and helps separate Redux idioms from your business logic.

The simplest reducer

A reducer is a pure function that accepts more arguments than it returns. That is to say - one whose "arity" is greater than 1. It 'reduces' the two things you pass it down to a single value. Here are two reducers, in a map

@parth7676
parth7676 / bprop.snippet
Last active February 19, 2021 03:18
Bindable Property Snippet for Xamarin Forms.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>bprop</Title>
<Author>Microsoft Corporation</Author>
<Description>Code snippet for an automatically implemented $name$Property
@alexrainman
alexrainman / ITextMeter
Last active August 1, 2022 07:45
Calculate Xamarin.Forms label height by amount of text
namespace YourNamespace
{
public interface ITextMeter
{
double MeasureTextSize(string text, double width, double fontSize, string fontName = null);
}
}
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@dylwylie
dylwylie / download_egghead_videos.md
Last active April 12, 2016 17:55 — forked from christiangenco/download_egghead_videos.md
download egghead videos
@Keboo
Keboo / MultiBinding.cs
Last active September 17, 2020 07:18
A simple MultiBinding class for Xamarin.Forms. This "binding" only works when directly applied to an element.
/*
WARNING: This MultiBinding implementation only works when it is directly applied to its target property.
It will fail if used inside of a setter (such is the case when used within a trigger or style).
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;