Skip to content

Instantly share code, notes, and snippets.

View Zeyad-37's full-sized avatar

Zeyad Zeyad-37

View GitHub Profile
package com.experiments.preferencehelper
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import com.experiments.preferencehelper.PreferenceHelper.get
import com.experiments.preferencehelper.PreferenceHelper.set
class MainActivity : AppCompatActivity() {
@adavis
adavis / CommonExtensions.kt
Last active April 2, 2024 20:51
Common Android Extensions in Kotlin
fun View.visible() {
visibility = View.VISIBLE
}
fun View.invisible() {
visibility = View.INVISIBLE
}
fun View.gone() {
visibility = View.GONE
@tiwiz
tiwiz / AddWifiNetwork.java
Last active October 27, 2018 23:14
Add your Wi-Fi Network to Android Things
String networkSSID = "Your Network SSID here";
String networkPasskey = "YourNetworkPasswordHere";
WifiConfiguration wifiConfiguration = new WifiConfiguration();
wifiConfiguration.SSID = "\"" + networkSSID + "\"";
wifiConfiguration.preSharedKey = "\"" + networkPasskey + "\"";
WifiManager manager = (WifiManager) getSystemService(WIFI_SERVICE);
manager.addNetwork(wifiConfiguration);
@andkon
andkon / index.js
Created January 17, 2017 18:06
Realm Mobile Platform PE — wit.ai NLP event handling demo
'use strict';
var fs = require('fs');
var Realm = require('realm');
const {Wit, log} = require('node-wit');
// Insert the Realm admin token
// Linux: `cat /etc/realm/admin_token.base64`
@devunwired
devunwired / FlickerActivity.java
Created December 22, 2016 22:27
Quick Android Things demo using ObjectAnimator to animate the brightness of a PWM output. This example uses a BounceInterpolator to create a flickering effect on an LED (like a candle).
/*
* Copyright 2016 Google Inc.
*
* 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
@donnfelker
donnfelker / .gitconfig
Last active August 15, 2021 10:05
My .gitconfig
[user]
name = FirstName LastName
email = you@yourdomain.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD