Skip to content

Instantly share code, notes, and snippets.

@abersnaze
abersnaze / InlineInlineMonacoEditor.stories.tsx
Last active September 17, 2020 12:21
React component, in typescript, wrapping Monaco editor to automatically grow & shrink with content to avoid scroll.
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import InlineMonacoEditor from './InlineMonacoEditor';
export const LINES = [
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'Aenean aliquet, nulla eget auctor porttitor, lacus urna',
'posuere purus, at suscipit orci sapien quis est. Curabitur',
@fxbeckers
fxbeckers / GZipMiddleware.cs
Last active October 17, 2016 04:35
Pretty naive version of an OWIN/Katana middleware gzipping response stream whose length meets fixed requirements.
public sealed class GZipMiddleware {
private readonly Func<IDictionary<string, object>, Task> next;
public GZipMiddleware(Func<IDictionary<string, object>, Task> next) {
this.next = next;
}
public async Task Invoke(IDictionary<string, object> environment) {
var context = new OwinContext(environment);
@skl
skl / Git to Stash Mirror
Created February 24, 2014 16:24
Mirror public git repositories to an Atlassian Stash instance
#!/bin/bash
set -e
function stash_create_repo()
{
local username="$1"
local password="$2"
local hostname="$3"
local port="$4"
local project="$5"
@nikhgupta
nikhgupta / example.html
Last active January 4, 2016 03:19
FuelUX Form Wizard in AngularJS
<wizard class="form-horizontal" id="timeline">
<step title="Welcome">
<label for="title">Title (required):</label>
<input type="text" name="title" id="title" class="form-control"
required placeholder="Your Timeline Title" ng-model="currEL.title" />
<ul ng-show="$$prevSibling.step.title.$dirty && $$prevSibling.step.title.$invalid" class="ng-error-list">
<li ng-show="$$prevSibling.step.title.$error.required">An eventline, definitely, needs a title. Don't you think?</li>
</ul>
<!-- TODO: maybe use errors like this for every step -->
<!-- <errors> -->
@yetithefoot
yetithefoot / stuns
Last active October 17, 2024 21:42 — forked from zziuni/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},