Skip to content

Instantly share code, notes, and snippets.

@Kuirak
Kuirak / gun-test.ts
Last active March 25, 2018 04:02
Gun TS typings
import * as Gun from "gun";
interface Schema {
mark: Person;
}
var gun = Gun<Schema>();
gun.put("test"); // should fail
gun.put(["test"]); // should fail
@swlaschin
swlaschin / ndclondon17_fp_track.md
Last active July 10, 2017 11:04
Functional Track talks from NDC London 2017

Functional Track talks from NDC London 2017

Also, here is the list of all videos from NDC London 2017:

Wednesday 2017-01-18

@stuartleeks
stuartleeks / ConvertFromDocker.ps1
Last active October 31, 2019 18:52
ConvertFrom-Docker
function PascalName($name){
$parts = $name.Split(" ")
for($i = 0 ; $i -lt $parts.Length ; $i++){
$parts[$i] = [char]::ToUpper($parts[$i][0]) + $parts[$i].SubString(1).ToLower();
}
$parts -join ""
}
function GetHeaderBreak($headerRow, $startPoint=0){
$i = $startPoint
while( $i + 1 -lt $headerRow.Length)
@srquinn21
srquinn21 / Makefile
Last active December 15, 2020 16:19
Frontend Development with Makefile
#==========================================================
# Environment/Configuration
#==========================================================
# For project consistency, its better to depend on npm binaries loaded locally than
# globally, so we add .node_modules/.bin to the path for shorthand references. This
# means you should add any binaries you need to "devDependencies" in package.json.
export PATH := ./node_modules/.bin/:$(PATH)
# Pull in the name and version from package.json. The name will default to "app" if not set.
@donnut
donnut / currying.md
Last active October 28, 2023 17:58
TypeScript and currying

TypeScript and currying

In functional programming you often want to apply a function partly. A simple example is a function add. It would be nice if we could use add like:

var res2 = add(1, 3); // => 4

var add10To = add(10);
var res = add10To(5); // => 15
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
-------Frameworks------
EmberJS
AngularJS
React
Flight
BackboneJS / UnderscoreJS <- Use lodash instead of underscore
-------Build Tools-----
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@creationix
creationix / path.js
Created November 12, 2013 18:10
Simple path join and dirname functions for generic javascript
// Joins path segments. Preserves initial "/" and resolves ".." and "."
// Does not support using ".." to go above/outside the root.
// This means that join("foo", "../../bar") will not resolve to "../bar"
function join(/* path segments */) {
// Split the inputs into a list of path commands.
var parts = [];
for (var i = 0, l = arguments.length; i < l; i++) {
parts = parts.concat(arguments[i].split("/"));
}
// Interpret the path commands to get the new resolved path.