Skip to content

Instantly share code, notes, and snippets.

View shishkin's full-sized avatar

Sergey Shishkin shishkin

View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 8, 2024 22:50
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@viktorklang
viktorklang / Gistard.scala
Last active June 9, 2017 07:27
Gistard — an sbt autoplugin for depending on Gists — such as Gistard itself
/*
Copyright 2015 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@jbtule
jbtule / build.fsx
Last active March 24, 2020 16:06
Crossplatform FSharp Makefile Bootstrapper
#!/bin/sh
#if run_with_bin_sh
# Doing this because arguments can't be used with /usr/bin/env on linux, just mac
exec fsharpi --define:mono_posix --exec $0 $*
#endif
(*
* Crossplatform FSharp Makefile Bootstrapper
* Apache licensed - Copyright 2014 Jay Tuley <jay+code@tuley.name>
* v 2.0 https://gist.github.com/jbtule/9243729
@martinei
martinei / gist:7143036
Created October 24, 2013 19:00
KataTennis
object Tennis {
// A Typesafe solution for http://codingdojo.org/cgi-bin/wiki.pl?KataTennis
sealed trait Player
case class Player1() extends Player
case class Player2() extends Player
sealed trait Score
case class NScore [+P <: Score]() extends Score()
type Score0 = NScore[Score]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//link[@rel='import']">
<xsl:copy-of select="document(@href)" />
</xsl:template>
</xsl:stylesheet>
@aviflax
aviflax / gist:3147740
Created July 19, 2012 23:55
Compile your CoffeeScript along with your Clojure
;;; Compile your CoffeeScript along with your Clojure
;; NOTE: For Clojure projects using Leiningen 1.7.x.
;; Instructions for Leiningen 2.0.x coming soon.
;; Step 1: add [robert/hooke "1.1.2"] to the :dev-dependencies option of your defproject call
;; Step 2: add the following code to the bottom of your project.clj:
(require ['robert.hooke :as 'hooke]
@stuartsierra
stuartsierra / lein2-issue.md
Created July 6, 2012 21:04
'file:' repositories in Leiningen 2.0.0-preview5 and later

Sample Project

Starting from:

lein new foo
cd foo

Say I have a random JAR file that is not available in any repository:

touch README.md

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline