Skip to content

Instantly share code, notes, and snippets.

View sampathsris's full-sized avatar

Sampath Sitinamaluwa sampathsris

View GitHub Profile
@sampathsris
sampathsris / Composer.cs
Created November 8, 2018 02:27
A function composer in C#
using System;
using System.Linq;
namespace IntObjectTest
{
public class Composer
{
static void Main()
{
Func<string, Func<string, string>> createAdder = s => x => x + s;
@sampathsris
sampathsris / aurena.js
Last active September 18, 2018 03:44
Authenticate an IFS Aurena endpoint with DB Provider in Node.js and retrieve a projection
/**
* This is a crude hack to connect to an IFS Aurena endpoint using IFS Database
* Identity Provider, and then query for projections from Node.js. Not sure the
* purpose of this, but feeling it would come handy for something. You can do
* the same in Postman, but I'm feeling the stateful client (read: with cookies)
* will be helpful in chaining requests.
*
* Tested with:
* "dom-parser": "^0.1.5",
* "request": "^2.87.0",
@gaearon
gaearon / modern_js.md
Last active June 11, 2024 07:33
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version