Skip to content

Instantly share code, notes, and snippets.

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

Sergey Nes sergenes

🏠
Working from home
View GitHub Profile
//first
dispatch_async(queue, ^{
dispatch_group_t group1 = dispatch_group_create();
// Tasks goes here
for (NSInteger i = 0; i < 3; i++) {
@sergenes
sergenes / lambda.js
Created October 11, 2022 20:10 — forked from phrozenra/lambda.js
Google in app purchase validation using AWS Lambda
import ApiBuilder from "claudia-api-builder";
import fetch from "node-fetch";
import FormData from "form-data";
let api = new ApiBuilder();
const verifyAndroidReceipt = req => {
// setup credentials
const config = {
client_id: "<fill in>",
@sergenes
sergenes / PhonecallReceiver.java
Created November 2, 2018 14:52 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@sergenes
sergenes / bluetooth-raspberry-pi-communication.py
Created August 27, 2018 13:46 — forked from keithweaver/bluetooth-raspberry-pi-communication.py
Sending information with bluetooth on Raspberry Pi (Python)
# Uses Bluez for Linux
#
# sudo apt-get install bluez python-bluez
#
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html
import bluetooth
def receiveMessages():
@sergenes
sergenes / nodejs-tcp-example.js
Created August 13, 2016 02:06 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');