Skip to content

Instantly share code, notes, and snippets.

View igr's full-sized avatar
🌤️
👋

Igor Spasić igr

🌤️
👋
View GitHub Profile
@antingle
antingle / CustomMacTextView.swift
Last active March 15, 2024 06:19 — forked from unnamedd/MacEditorTextView.swift
CustomMacTextView - A simple NSScrollView wrapped by SwiftUI with placeholder text
//
// CustomMacTextView.swift
//
// MacEditorv2 Created by Marc Maset - 2021
// Changes inspired from MacEditorTextView by Thiago Holanda
//
// Modified by Anthony Ingle - 2022
//
import SwiftUI
@sindresorhus
sindresorhus / esm-package.md
Last active April 24, 2024 09:47
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.
@elizarov
elizarov / Wrapper.kt
Created June 5, 2019 21:58
Simple wrapper function combinator engine for Kotlin
// ============ test functions ============
fun withTransactional() = transactional {
println("withTransactional body")
}
fun withLogged() = logged {
println("withLogged body")
}
@moh-sushi
moh-sushi / benchmark statistic - jodd #439.txt
Created October 12, 2017 11:43
benchmark for StringUtil#replace executed with changes of #439
Benchmark Mode Cnt Score Error Units
StringUtilReplaceBenchmark.testStringReplaceLongStringNoMatch thrpt 21 3934305,776 ± 257369,463 ops/s
StringUtilReplaceBenchmark.testStringReplaceLongStringOneMatch thrpt 21 964201,767 ± 29390,765 ops/s
StringUtilReplaceBenchmark.testStringReplaceLongStringSeveralMatches thrpt 21 742069,544 ± 23570,739 ops/s
StringUtilReplaceBenchmark.testStringReplaceShortStringNoMatch thrpt 21 5079240,512 ± 304600,596 ops/s
StringUtilReplaceBenchmark.testStringReplaceShortStringOneMatch thrpt 21 2663456,731 ± 101788,369 ops/s
StringUtilReplaceBenchmark.testStringReplaceShortStringSeveralMatches thrpt 21 1571368,685 ± 63015,210 ops/s
StringUtilReplaceBenchmark.testApacheStringUtilsReplaceLongStringNoMatch thrpt 21 14538981,034 ±
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 23, 2024 13:36 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@raphw
raphw / FieldBenchmark.java
Last active March 4, 2024 00:14
Java MethodHandle and reflection benchmark
package benchmark;
import org.openjdk.jmh.annotations.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.TimeUnit;
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@kchida
kchida / gist:d1c15f3968f4f8272c49
Created July 17, 2014 05:06
etcd vs consul vs ???
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@zacharyz
zacharyz / gist:6043337
Created July 20, 2013 00:47
setup bt sync on digital ocean
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:tuxpoldo/btsync
sudo apt-get update
sudo apt-get install btsync
During the installation just use the default setting and set the administrative password as well ,You can access it by
127.0.0.1:8888 # This will redirect to the 2nd link
OR
http://127.0.0.1:8888/gui/
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.