Skip to content

Instantly share code, notes, and snippets.

View igr's full-sized avatar
🌤️
👋

Igor Spasić igr

🌤️
👋
View GitHub Profile
@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/
@mceachen
mceachen / .travis.yml
Created April 9, 2012 01:28
Travis CI with multiple database engines
language: ruby
rvm:
- 1.9.3
env:
- DB=sqlite
- DB=mysql
- DB=postgresql
@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 ±
@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")
}
@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.
@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
@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;
@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
@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.

@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out