Skip to content

Instantly share code, notes, and snippets.

@skyline75489
skyline75489 / prompt.sh
Last active December 18, 2022 08:44
Windows Terminal OSC 9;9 for Bash & Zsh in WSL
__wt_osc9_9 () {
_win_path=$(wslpath -m $(pwd))
printf "\033]9;9;%s\033\\" "$_win_path"
}
[ -n "$BASH_VERSION" ] && [ -n "$WT_SESSION" ] && PROMPT_COMMAND="__wt_osc9_9"
[ -n "$ZSH_VERSION" ] && [ -n "$WT_SESSION" ] && precmd_functions+=(__wt_osc9_9)
true

Reason

I have heard a lot of complaints about lack of editor integration or flaky editor tooling in the Reason community. At my previous job we had ~3000 modules and ~80k LOC. I'll admit that we were not very vigilant with .rei files or keeping our inter module dependencies really clean so this slowed both bsb and especially reason-language-server down a lot.

In fact so much that people couldn't use reason-language-server anymore on 15" MacBook Pros.

I myself have always used a Merlin based setup since I joined the Reason eco system before reason-language-server, and in our project my setup had never failed. Therefor I went on a quest of setting up 3 of the major editors (Emacs, Vim and VSCode) and documenting how to get them working

@akoppela
akoppela / README.md
Last active June 10, 2023 18:32
Custom Elements with ES5 syntax

You'll need to include two pollyfils before you include a code with your custom elements:

webcomponents/webcomponentsjs/custom-elements-es5-adapter.js - this is for new browsers in order to understand ES5 syntax

webcomponents/custom-elements/custom-elements.min.js - this is for old browsers without customElements support

You can add them to your index.html file in the following way:

<div id="custom-elements-adapter">
@thesocialdev
thesocialdev / npm_repository_info.sh
Last active October 22, 2018 14:53
This Bash script is a prototype that recursively checks npm dependencies and its info and saves it into a CSV file.
#!/bin/sh
# Set NPM tree depth of search
DEPTH=2
# SET Github Development Token to search for repos in Github
OAUTH_TOKEN=
# SET Header with proper authorization
GITHUB_HEADER="Authorization: token ${OAUTH_TOKEN}"
# Path to CSV generated files
CSV_PATH="/path/to/csv/generated/files"
@mfeineis
mfeineis / ElmFsaPorts.elm
Last active March 6, 2018 01:53
This is a "minimal" example for integrating Elm with Flux-Standard-Actions of ReactJS fame (https://ellie-app.com/d6C53Vf3Pa1/0).
port module ElmFsaPorts exposing (main)
import Html exposing (Html, text)
import Json.Decode as Decode exposing (Decoder, Value)
import Json.Encode as Encode
port fromElm : Value -> Cmd msg
import React from 'react';
import lively from 'lively';
// Global registry and resize handler
let _registeredInstances = [];
function register(inst) {
if (_registeredInstances.length === 0) {
window.addEventListener('resize', onResize);
}
@jdlrobson
jdlrobson / pixies.py
Last active February 20, 2019 19:35
#!/usr/bin/env python
'''
Copyright [2017] [Jon Robson]
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
import React, { PropTypes, Component } from 'react'
import { getRef, listToArray } from '../utils/firebase'
import { ErrorMessage, Loading } from '../Theme'
/*
```js
<Ref path="/somewhere">
{({ error, loaded, value }) => (
// `value` is an object w/ keys
@tduarte
tduarte / publish-ghpages.md
Last active May 18, 2024 13:52
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@jdlrobson
jdlrobson / profile_getText.php
Created March 10, 2016 22:52
profile_getText.php
<?php
require_once( '../../includes/libs/ReplacementArray.php' );
require_once( '../../includes/HtmlFormatter.php' );
function wfIsWindows () { return false; };
require_once( 'includes/MobileFormatter.php' );
const NUMBER_RUNS = 100;
$filenames = array(