Skip to content

Instantly share code, notes, and snippets.

@andrienko
andrienko / monacoDragAndDropProvider.ts
Last active April 30, 2024 18:00
Monaco drag and drop provider
import React from 'react';
import { editor } from 'monaco-editor';
import IMouseTarget = editor.IMouseTarget;
import IStandaloneCodeEditor = editor.IStandaloneCodeEditor;
import IContentWidget = editor.IContentWidget;
const { ContentWidgetPositionPreference } = editor;
export type TDropHandler = (e: React.DragEvent, target: IMouseTarget, instance: IStandaloneCodeEditor) => void;
export type TInstanceGetter = () => IStandaloneCodeEditor;
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@y2q-actionman
y2q-actionman / a_road_to_common_lisp_jp.md
Last active April 30, 2024 17:55
A Road to Common Lisp 翻訳

この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。

原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/


A Road to Common Lisp (Common Lisp への道)

これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。

@darrenwiens
darrenwiens / index.html
Created April 29, 2024 23:55
High Res Canopy Height COG viewer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>High Resolution Canopy Height</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.js"></script>
<style>
@stefanahman
stefanahman / clear_queues.rb
Created September 10, 2018 10:38
Remove jobs from Resque queues
# Active job
queue_name = 'netsuite_low'
class_name = 'PurchaseOrder::ImportSingleFromNetsuiteJob'
active_job_class = 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper'
# active_job_class = 'ActiveScheduler::ResqueWrapper'
args = Resque.peek(queue_name,0,10000).select { |job| job['args'].to_s.include?(class_name) }.flat_map{ |job| job['args'] }; nil
args.each { |arg| Resque::Job.destroy(queue_name, active_job_class, arg) }; nil
# Resque
queue_name = 'netsuite'
@Obydux
Obydux / Fabric-Quilt-Server-Optimization.md
Last active April 30, 2024 17:50
Fabric/Quilt Server Optimization

Fabric/Quilt Server Optimization

This has updated for 1.20.4, all of the optimization mods mentioned here are compatible with each other and don't affect vanilla behaviour by default.

Mods

Lithium - A mod designed to drastically improve the general performance of Minecraft without breaking things.

VMP - A mod designed to improve general server performance at high playercount.

@wojukasz
wojukasz / keybindings.json
Created March 31, 2023 11:43
VsCode + Vim keybindings and settings - best of both worlds
[
//
// VIM NAVIGATION SHORTCUTS
//
{
// "ctrl+h": Focuses on the left editor group when the text editor is focused, Vim extension is active, and Vim is not in Insert mode.
"key": "ctrl+h",
"command": "workbench.action.focusLeftGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
@hnakamur
hnakamur / Dockerfile
Created June 11, 2020 00:27
Dockefile to build nginx-quic with BoringSSL on Ubuntu 20.04 LTS
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install git mercurial build-essential cmake ninja-build golang-go zlib1g-dev libpcre3-dev
RUN git clone https://github.com/google/boringssl \
&& cd boringssl \
&& mkdir build \
&& cd build \
&& cmake -GNinja .. \