Skip to content

Instantly share code, notes, and snippets.

View dbacinski's full-sized avatar
🏠
Working remotely

Dariusz Baciński dbacinski

🏠
Working remotely
View GitHub Profile
using System.Threading.Tasks;
using Newtonsoft.Json;
using Refit;
using System.Net.Http;
using System;
namespace wms_xamarin
{
public class LoginApi
{
@plieningerweb
plieningerweb / zenbook-ux310-ua-ubuntu-16-10.md
Last active February 3, 2021 16:00
Ubuntu 16.10 Linux on Asus ZenBook UX310UA

Ubuntu 16.10 on Asus ZenBook UX310UA

What is working:

  • Keyboard
    • Backlight control
    • Screenlight contro
    • Volumne, Display on/off, Touchbad
    • Seems like everything is working
  • Trackpad is ok
  • Wireless
@eliangcs
eliangcs / http-prompt-story.md
Last active June 3, 2020 06:49
How I created HTTP Prompt and got 5000+ stars on GitHub

How I Created HTTP Prompt and Got 5000+ Stars on GitHub

Two months ago, I published an open source project, which went viral by gaining 1200+ stars in the first 24 hours. As of this writing, it has attracted 5000+ stars. The project is called HTTP Prompt:

https://github.com/eliangcs/http-prompt

Here I want to share its development story.

It all began with Vertica. Not long ago, I used Vertica every day for my work. Vertica is a powerful database, but the official client (vsql) is not powerful at all. The GUI alternative, DbVisualizer, is bad as well.

@dlew
dlew / File.java
Created March 1, 2016 20:46
Automated onError() message generation
public static Action1<Throwable> crashOnError() {
final Throwable checkpoint = new Throwable();
return throwable -> {
StackTraceElement[] stackTrace = checkpoint.getStackTrace();
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()`
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)",
element.getClassName(),
element.getMethodName(),
element.getFileName(),
element.getLineNumber());
@neworld
neworld / howto.md
Last active July 10, 2024 11:24
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
@JakeWharton
JakeWharton / Java6.java
Last active May 28, 2022 16:14
A comparison between non-capturing and capturing expressions across Java 6, Java 8, Java 8 with Retrolambda, Kotlin with native function expressions, and Kotlin with Java SAM expression.
import java.util.Arrays;
class NonCapturing {
public static void main(String... args) {
run(new Runnable() {
@Override public void run() {
System.out.println("Hey!");
}
});
}
@dbacinski
dbacinski / espresso_m_test
Last active January 8, 2016 15:50
Spock + Espresso + Dagger2 + Runtime Permissions + RxJava
Spock + Espresso + Dagger2 + Runtime Permissions + RxJava
Test:
https://github.com/dbacinski/meteopl-unofficial/blob/master/app/src/androidTest/groovy/pl/dariuszbacinski/meteo/location/LocationSaveSpec.groovy#L25
Test Stubs Setup:
https://github.com/dbacinski/meteopl-unofficial/blob/master/app/src/androidTest/groovy/pl/dariuszbacinski/meteo/location/LocationSetup.groovy#L38
Stubbed Objects:
https://github.com/dbacinski/meteopl-unofficial/blob/master/app/src/main/java/pl/dariuszbacinski/meteo/location/model/CoarseLocation.java#L27
Dagger2 local component provider:
https://github.com/dbacinski/meteopl-unofficial/blob/master/app/src/main/java/pl/dariuszbacinski/meteo/location/view/LocationFragment.java#L216
@vitorbritto
vitorbritto / rm_mysql.md
Last active November 5, 2024 05:41
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@twksos
twksos / CiscoVPNConnection.scpt
Last active July 31, 2023 20:50
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
@azell
azell / Spring Txn and jOOQ 3.7.0
Last active April 11, 2020 19:05
Attempting to integrate Spring Transaction with jOOQ 3.7.0
public class SpringExceptionTranslationExecuteListener
extends DefaultExecuteListener {
/** {@inheritDoc} */
@Override
public void exception(ExecuteContext ctx) {
SQLException e = ctx.sqlException();
if (e != null) {
String name = ctx.configuration().dialect().thirdParty().springDbName();