Skip to content

Instantly share code, notes, and snippets.

View sytolk's full-sized avatar
🏠
Working from home

Stanimir sytolk

🏠
Working from home
  • Structmedia
  • Bulgaria
View GitHub Profile
@kanru
kanru / Android.mk
Created January 6, 2012 04:16
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@bjornharrtell
bjornharrtell / proguard.cfg
Created August 9, 2012 20:58
Proguard config for akka including akka remote (tested with akka 2.0.2)
-dontwarn org.jboss.netty.logging.**
-dontwarn org.osgi.**
-dontwarn javax.servlet.**
-dontwarn org.jboss.netty.channel.socket.http.**
## Unsafe is there at runtime
-dontwarn sun.misc.Unsafe
-keep class sun.misc.Unsafe{
*;
}
@PaulCapestany
PaulCapestany / get_and_delete_sync_gateway_docs.sh
Last active March 12, 2018 12:30
GET _all_docs from sync_gateway and parse with `jq`. Then, iterate through list to delete all/whichever docs you want to delete. More info in comments.
#!/bin/bash
##########
# README #
##########
# Make sure you've got the CLI tool `jq` installed
# ↳ http://stedolan.github.io/jq/
# (if you've got homebrew on your Mac just do → `brew install jq`)
@benvium
benvium / retrofit-custom-error-handling.java
Created August 29, 2014 19:45
Fairly simply Retrofit custom error handling example. Is set up so that you don't need to do much work in the 'failure' handler of a retrofit call to get the user-visible error message to show. Works on all endpoints. There's lots of exception handling as our server folks like to keep us on our toes by sending all kinds of random stuff..!
// on error the server sends JSON
/*
{ "error": { "data": { "message":"A thing went wrong" } } }
*/
// create model classes..
public class ErrorResponse {
Error error;
@julianxhokaxhiu
julianxhokaxhiu / README.md
Last active April 19, 2022 20:09
How to install OSX 10.11 El Capitan on VMWare

How to install OSX 10.11 El Capitan on VMWare

To accomplish this tutorial you already need a previous copy of OSX installed on VMWare Player or Workstation.

0) Acquire a copy of OSX 10.11 El Capitan

First of all you need to acquire a legal copy of OSX El Capitan from the App Store. This tutorial will not cover this part. Sorry :)

1) Unlock OSX option on VMWare

Download the latest version of VMWare Unlocker and use the relative binary to unlock it ( based on your Host OS ).

@cyrixmorten
cyrixmorten / FucedLocationTracker.java
Created October 23, 2015 13:37
ReactiveLocation in Service
public class FusedLocationTrackerService extends InjectingService {
private static final String TAG = FusedLocationTrackerService.class.getSimpleName();
public FusedLocationTrackerService() {
}
public static void start(Context context) {
Log.e(TAG, "startGPSTrackerService");
@joinAero
joinAero / BluetoothCallback.java
Last active October 7, 2021 15:42
Android - The bluetooth listener and profile proxy.
package cc.cubone.turbo.core.bluetooth;
/**
* Interface definition for a callback to be invoked when bluetooth state changed.
*/
public interface BluetoothCallback {
/**
* Called when the bluetooth is off.
*/
@swankjesse
swankjesse / HostSelectionInterceptor.java
Last active May 17, 2024 19:11
This OkHttp application interceptor will replace the destination hostname in the request URL.
import java.io.IOException;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/** An interceptor that allows runtime changes to the URL hostname. */
public final class HostSelectionInterceptor implements Interceptor {
private volatile String host;
@kennyhyun
kennyhyun / index.js
Last active June 19, 2024 05:55
lamda thumbnail generator
// dependencies
var async = require('async');
var AWS = require('aws-sdk');
// Enable ImageMagick integration.
var gm = require('gm').subClass({ imageMagick: true });
var util = require('util');
var pdf2png = require('pdf2png');
pdf2png.ghostscriptPath = "/usr/bin";
// constants
@mfmendiola
mfmendiola / ArrayUtil.java
Last active April 5, 2023 19:10
ReadableArray and ReadableMap serialization helpers for the React Native—Android bridge.
/*
ArrayUtil exposes a set of helper methods for working with
ReadableArray (by React Native), Object[], and JSONArray.
MIT License
Copyright (c) 2020 Marc Mendiola
Permission is hereby granted, free of charge, to any person obtaining a copy