Skip to content

Instantly share code, notes, and snippets.

View dev-tim's full-sized avatar
☘️

Tim Zadorozhniy dev-tim

☘️
View GitHub Profile
@dev-tim
dev-tim / benchmark.md
Created July 5, 2023 11:30
Python GIL impact
@dev-tim
dev-tim / application.properties
Last active May 9, 2023 15:37
spring-boot-h2-config.properties
spring.datasource.url=jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
@dev-tim
dev-tim / .vimrc
Created November 8, 2021 18:55 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@dev-tim
dev-tim / .zshrc
Created July 6, 2020 20:12 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@dev-tim
dev-tim / .zshrc
Created July 6, 2020 20:12 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
function findAll(entityType: string, query: QueryObject): Promise<Array<any>> {
const table: Dexie.Table<any, any> = db.table(entityType);
// if there is filter query try to apply filters
const maybeFiltered = applyFilteringObject(table, query.filter);
const maybePaginated = applyPaginationObject(maybeFiltered, query.pagination)
const promise = maybePaginated.toArray();
return promise;
}
@dev-tim
dev-tim / xhr.js
Last active September 7, 2019 14:23
xhr
function get(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
callback(xhr.responseText)
}
}
xhr.open('GET', url, true);
xhr.send(null);
}
@dev-tim
dev-tim / Connectivity.java
Created June 26, 2017 20:54 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil
@dev-tim
dev-tim / MainActivityTest.java
Created June 26, 2017 19:12 — forked from vgonda/MainActivityTest.java
Example of how to use espresso-intents in Android tests
package com.collectiveidea.example;
import android.content.Intent;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.collectiveidea.example.ui.LoginActivity;
import com.collectiveidea.example.ui.MainActivity;
import com.collectiveidea.example.util.AccountUtility;
@dev-tim
dev-tim / gist:eaa68c3adb538920d5bda5f1a45ca8a1
Created June 8, 2017 12:49 — forked from lxneng/gist:741932
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql