Skip to content

Instantly share code, notes, and snippets.

View groupsky's full-sized avatar
💭
I may be very slow to respond.

Geno Roupsky groupsky

💭
I may be very slow to respond.
  • Plovdiv/Bulgaria
View GitHub Profile
@groupsky
groupsky / lock_sensor.ino
Created September 11, 2016 17:41
Lock sensor
#include <ESP8266WiFi.h>
#define SENSORPIN 4 // what pin we’re connected to
// replace with your channel’s thingspeak API key,
String tsApiKey = "ENTER API KEY HERE";
String ddId = "ENTER ID HERE";
const char* ssid = "hackafe.org";
const char* password = "";
@groupsky
groupsky / fix.sh
Created July 19, 2016 11:40
Fix android emulator CPU hog
ls ~/.android/avd/*/config.ini | xargs sed -i '/hw.audioInput=yes/c\hw.audioInput=no\nhw.audioOutput=no'
@groupsky
groupsky / BearingLocationSource.java
Last active April 20, 2016 09:28
BearingLocationSource
/*
Copyright 2016 Geno Roupsky
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@groupsky
groupsky / AndroidManifest.xml
Created June 17, 2015 18:32
Android Services & Alarms
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.hackafe.servicesalarms" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@groupsky
groupsky / pa-configure-remote.sh
Created July 22, 2014 13:21
Configure PulseAudio to discover and use remote servers
#!/bin/bash
sudo apt-get install pulseaudio-module-zeroconf
pacmd load-module module-native-protocol-tcp
pacmd load-module module-zeroconf-discover
sudo service avahi-daemon restart
echo "Select one of the available sinks to stream your audio"
echo "pacmd set-default-sink <index|name>"
echo
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
@groupsky
groupsky / min_jquery_version.js
Last active December 20, 2015 18:29 — forked from dshaw/min_jquery_version.js
Fix for jQuery version 1.10.0
function minVersion(version) {
var $vrs = window.jQuery.fn.jquery.split('.'),
min = version.split('.');
for (var i=0, len=$vrs.length; i<len; i++) {
console.log($vrs[i], min[i]);
if (min[i] && (+$vrs[i]) < (+min[i])) {
return false;
}
}
return true;
@groupsky
groupsky / scale_resources.sh
Created January 22, 2013 16:14
Convert drawable resources from xhdpi to hdpi, mdpi and ldpi
#!/bin/bash
# add desired categories
CATEGORIES=ldpi,mdpi,hdpi
# categories scale in % based on xhdpi
CATEGORIES_SCALE=37.5,50,75
IFS=',' read -a densities <<< "$CATEGORIES"
IFS=',' read -a scales <<< "$CATEGORIES_SCALE"
@groupsky
groupsky / gist:4501932
Last active December 10, 2015 22:28
deploy only release apps to all connected devices and use watchdog if adb hangs
# Timeout.
declare -i timeout=60
# Interval between checks if the process is still alive.
declare -i interval=1
# Delay between posting the SIGTERM signal and destroying the process by SIGKILL.
declare -i delay=1
function watchdog {
# $# should be at least 1 (the command to execute), however it may be strictly
# greater than 1 if the command itself has options.
@groupsky
groupsky / gist:4501582
Created January 10, 2013 12:13
deploy only release apps to all connected devices
for APK in `find $WORKSPACE -type f -name '*-release*.apk'`; do
if [[ "$APK" != *unaligned* ]]; then
if [[ "$APK" != *unsigned* ]]; then
for DEVICE in `adb devices | tail -n+2 | cut -f1`; do
echo "installing $APK on $i"
adb -s $DEVICE install -rs $APK
done
fi
fi
done