Skip to content

Instantly share code, notes, and snippets.

Naqi Syed naqi

  • Austin, TX
Block or report user

Report or block naqi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@naqi
naqi / LogstashService.java
Created May 30, 2019 — forked from dant3/LogstashService.java
Logstash Android client
View LogstashService.java
import android.app.AlarmManager;
import android.app.IntentService;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import java.io.*;
import java.net.*;
View gist:8f1a569520247e794757867d65a3b4a5
Message received: {"token":"hybmry9d","bridge":{"id":"1","pairing":0,"serial":"3813","error":0,"fwVer":"19","rfConfig":"US/Europe","bItv":6}, "valves":[{"id":"1","serial":"7936","statusCode":"0","temp":"58","open":"0","flow":"399","bat":"100","fwVer":"6","pulses":"399","rssi":"0"} ]}
Message sent to hybmry9d: {"bItv":6,"pairing":0,"updtBr":0,"date":"2018-06-30","event":{"current":0,"next":0},"valves":[{"id":"1","serial":7936,"update":0,"vItv":12,"deleted":0}]}
Message received: {"token":"hybmry9d","bridge":{"id":"1","pairing":0,"serial":"3813","error":0,"fwVer":"19","rfConfig":"US/Europe","bItv":6}, "valves":[{"id":"1","serial":"7936","statusCode":"128","temp":"58","open":"0","flow":"399","bat":"100","fwVer":"6","pulses":"399","rssi":"100"} ]}
Message sent to hybmry9d: {"bItv":6,"pairing":0,"updtBr":0,"date":"2018-06-30","event":{"current":0,"next":0},"valves":[{"id":"1","serial":7936,"update":0,"vItv":12,"deleted":0}]}
Message received: {"token":"hybmry9d","bridge":{"id":"1","pairing":0,"serial":"3813","erro
View gist:bd29d848d4cbd8b17027e32ba45de85e
Verifying my Blockstack ID is secured with the address 1LiUoHQAfVsrGfx4uzaT55r4JAonrmj7rq https://explorer.blockstack.org/address/1LiUoHQAfVsrGfx4uzaT55r4JAonrmj7rq
@naqi
naqi / bridge_to_cloud.json
Last active Jan 29, 2018
Zilker Cloud to bridge proposal
View bridge_to_cloud.json
Charator count: 778
{
"token":"afsadfasf",
"bridge": {
"id":"10",
"pairing":0,
"serial":"5551212",
"error":0,
"fwVer":"100100",
"rfConfig":"US/Europe",
@naqi
naqi / RenderScript.kt
Created Nov 8, 2016
render script blur
View RenderScript.kt
//Render script blur
layout_content.isDrawingCacheEnabled = true
val bitmap = Bitmap.createBitmap(layout_content.drawingCache)
layout_content.isDrawingCacheEnabled = false
val rs = RenderScript.create(this@FGSimpleRound)
val input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT)
val output = Allocation.createTyped(rs, input.getType())
val script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs))
@naqi
naqi / gource.sh
Last active Sep 2, 2016 — forked from cgoldberg/gource.sh
Gource - Mir development video
View gource.sh
# install bzr and gource
# get a branch of Mir's trunk code
# create gource video
$ sudo apt-get install bzr gource
$ bzr branch lp:mir
$ cd mir
$ gource \
-s .06 \
@naqi
naqi / ContactSync.m
Created Sep 2, 2016
Search for contact default container > unified contacts matching name predicate > loop to find matching contact with email address
View ContactSync.m
[addressBook containersMatchingPredicate:[CNContainer predicateForContainersWithIdentifiers: @[addressBook.defaultContainerIdentifier]] error:&contactError];
NSArray * keysToFetch = @[CNContactEmailAddressesKey, CNContactGivenNameKey];
CNContactFetchRequest * request = [[CNContactFetchRequest alloc]initWithKeysToFetch:keysToFetch];
request.predicate = [CNContact predicateForContactsMatchingName:user.fullName];
NSArray *result = [addressBook unifiedContactsMatchingPredicate:[CNContact predicateForContactsMatchingName:user.fullName]
keysToFetch:keysToFetch
error:&contactError];
CNContact *unifiedContact;
@naqi
naqi / utils.m
Last active Jan 21, 2016
Highlight order and stripping elastic suffix
View utils.m
+ (NSString *) getSortHighlightedField:(NSArray *) fieldList{
NSArray *highlightOrder= @[
@"nickname",
@"skills",
@"interests",
@"group_names",
@"birth_date",
@"start_date",
@"start_date_year",
@"email",
View gist:b41a9d4758440a7d666c
[manager enqueueBatchOfObjectRequestOperations:requests
progress:^(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations) {
NSLog(@"%lu/%lu", (unsigned long) numberOfFinishedOperations, (unsigned long) totalNumberOfOperations);
} completion:^(NSArray *operations) {
UIApplication *application = [UIApplication sharedApplication];
self.task = [application beginBackgroundTaskWithExpirationHandler:^{
NSLog(@"Took too long!");
[self.syncOperationQueue cancelAllOperations];
You can’t perform that action at this time.