Skip to content

Instantly share code, notes, and snippets.

@mtsmfm
mtsmfm / plugin.yaml
Last active Sep 16, 2021
My che-theia
View plugin.yaml
apiVersion: v2
publisher: eclipse
name: che-theia
version: next
type: Che Editor
displayName: theia-ide
title: Eclipse Theia development version.
description: 'Eclipse Theia, get the latest release each day.'
icon: /images/default.png
category: Editor
@mtsmfm
mtsmfm / plugin.yaml
Last active Sep 1, 2021
rust-analyzer
View plugin.yaml
apiVersion: v2
publisher: matklad
name: rust-analyzer
version: latest
type: VS Code extension
displayName: Rust Analyzer
title: Rust Analyzer
description: Rust Analyzer
icon: https://github.com/rust-analyzer/rust-analyzer/raw/master/assets/logo-square.svg
category: Programming Languages
@mtsmfm
mtsmfm / README.md
Last active Aug 10, 2021
Install eclipse che on docker desktop
View README.md
$ kubectl apply -f https://gist.githubusercontent.com/mtsmfm/7d582a83f2c963273612d6dcd8f856c1/raw/6ebaff9d92a062d7cb886ff22bcad57c36f6f1cf/coredns-configmap.yaml
$ kubectl patch deployment coredns -n kube-system --patch "$(curl https://gist.githubusercontent.com/mtsmfm/7d582a83f2c963273612d6dcd8f856c1/raw/6ebaff9d92a062d7cb886ff22bcad57c36f6f1cf/coredns-deployment-patch.yaml)"
$ chectl server:deploy --platform=docker-desktop --domain che.127.0.0.1.nip.io
@mtsmfm
mtsmfm / a.rb
Last active Sep 9, 2021
Find not used Rails endpoints via BigQuery
View a.rb
require 'bundler/inline'
gemfile do
eval File.read(File.join(__dir__, 'Gemfile'))
gem 'js_regex'
gem 'pry-byebug'
end
require_relative 'config/environment'
@mtsmfm
mtsmfm / background.js
Created May 31, 2021
tabCapture with v3 manifest
View background.js
chrome.action.onClicked.addListener(() => {
console.log(chrome.tabCapture);
});
View lp_gen.rb
class LpGen
INFINITY = Float::INFINITY
module HasMembers
def set_coefficient(var, x)
members << Member.new(var, x)
end
def members
@members ||= []
@mtsmfm
mtsmfm / report.rb
Last active Dec 11, 2020
Report N+1 via New Relic API
View report.rb
require 'net/http'
require 'uri'
require 'json'
require 'time'
require 'csv'
class NrqlClient
def initialize(api_key:, account_id:)
@api_key = api_key
@account_id = account_id
View rewrite.go
package main
import (
"go/ast"
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"log"
"os"
View result.txt
$ DATABASE_URL=postgres://postgres:password@postgres/postgres?sslmode=disable go run utils/foo.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x68e9dc]
goroutine 1 [running]:
github.com/ericlagergren/decimal.(*Big).IsNaN(...)
/home/app/go/pkg/mod/github.com/ericlagergren/decimal@v0.0.0-20181231230500-73749d4874d5/big.go:853
github.com/volatiletech/sqlboiler/v4/types.decimalValue(0x0, 0x8fe300, 0x0, 0x0, 0x7fa1a03ebca0, 0x8a9601)
/home/app/go/pkg/mod/github.com/volatiletech/sqlboiler/v4@v4.2.0/types/decimal.go:140 +0x3c
github.com/volatiletech/sqlboiler/v4/types.Decimal.Value(0x0, 0xc0001a15f0, 0x40d1e5, 0x6c4760, 0x7007c0)
View mongoid_test.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'mongoid'
end
require 'yaml'
require 'tempfile'