Skip to content

Instantly share code, notes, and snippets.

View m25lazi's full-sized avatar

Mohammed Lazim m25lazi

View GitHub Profile
@m25lazi
m25lazi / wpa_supplicant.conf
Created November 5, 2017 13:55
Headless setup - rPI Zero W
network={
ssid="Your WiFi SSID"
psk="Correct Password for the same"
}
@m25lazi
m25lazi / keybase.md
Last active February 13, 2019 10:15
Keybase verification

Keybase proof

I hereby claim:

  • I am m25lazi on github.
  • I am m25lazi (https://keybase.io/m25lazi) on keybase.
  • I have a public key ASBXJ0Ym5z7ej1MlruGNMGncqXHyjm-mVtZ328UxyJC1xQo

To claim this, I am signing this object:

@m25lazi
m25lazi / UIImage+Inceptionv3.swift
Created August 5, 2017 06:46
UIImage extension for using in Inception
extension UIImage {
func buffer() -> CVPixelBuffer? {
return UIImage.buffer(from: self)
}
static func buffer(from image: UIImage) -> CVPixelBuffer? {
// as explained in https://www.hackingwithswift.com/whats-new-in-ios-11
// ...
}
@m25lazi
m25lazi / Inceptionv3.swift
Last active August 5, 2017 06:41
Prediction API generated by Xcode from Inceptionv3 model
/**
Make a prediction using the convenience interface
- parameters:
- image: Input image to be classified as RGB image buffer, 299 pixels wide by 299 pixels high
- throws: an NSError object that describes the problem
- returns: the result of the prediction as Inceptionv3Output
*/
func prediction(image: CVPixelBuffer) throws -> Inceptionv3Output {
let input_ = Inceptionv3Input(image: image)
return try self.prediction(input: input_)
@m25lazi
m25lazi / inception-predition.swift
Created August 5, 2017 06:28
Using Inception Model to predict the object
var model = Inceptionv3()
let output = try? model.prediction(image: pixelBuffer)
let prediction = output?.classLabel ?? “I don’t know! 😞”
@m25lazi
m25lazi / MyModule.js
Created June 19, 2017 20:13
Module pattern in JS
// Taken from Addy Osmani's Essential JS Design Patterns
// https://addyosmani.com/resources/essentialjsdesignpatterns/book/#constructorpatternjavascript
var myNamespace = (function () {
var myPrivateVar, myPrivateMethod;
// A private counter variable
myPrivateVar = 0;
// A private function which logs any arguments
@m25lazi
m25lazi / info.plist
Created June 15, 2017 21:01
iOS 9 Application Query Schemes in info plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fb</string>
<string>googlechrome</string>
<string>googlechromes</string>
</array>
@m25lazi
m25lazi / Command
Created January 24, 2017 09:00
Install .app file into simulator
xcrun simctl install booted <Path to .app>
@m25lazi
m25lazi / generate-pushid.js
Created April 3, 2016 13:40 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@m25lazi
m25lazi / bloqClient.ino
Last active March 24, 2016 17:55
Bloq Example 1 (Control Digital/Analog Arduino pins via Bloq Server)
/*
Should include these additional libraries:
* Ethernet
* SPI
* ArduinoJson by bblanchon (https://github.com/bblanchon/ArduinoJson)
Bloq Library includes Arduino-RestClient Library by csquared (https://github.com/csquared/arduino-restclient)
Device Type - 0 : Appliance, 1 : Sensor
Data Type - 0 : Digital, 1 : Analog