Skip to content

Instantly share code, notes, and snippets.

@omfaer
omfaer / snackbar.java
Created October 11, 2024 11:57
Custom SnackBar
public static void showSnackbar(Activity activity, View view){
Snackbar snackbar = Snackbar.make(view, "", Snackbar.LENGTH_SHORT);
Snackbar.SnackbarLayout snackbarLayout = (Snackbar.SnackbarLayout) snackbar.getView();
snackbar.getView().setBackgroundColor(Color.TRANSPARENT);
View customSnackView = activity.getLayoutInflater().inflate(R.layout.snackbar_rounded, null);
snackbarLayout.addView(customSnackView, 0);
snackbar.show();
}
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
String isim = "OMFAER";
int parola = 1001;
void setup()
{
Serial.begin(9600);
Serial.println("AT Komutları Çalıştırılıyor..");
@omfaer
omfaer / hc05BluetoothConfig.ino
Created August 18, 2020 12:46
HC-05 Bluetooth Module Configuration Mode.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
Serial.begin(9600);
Serial.println("Device is ready. You can type AT command...");
BTSerial.begin(38400); // HC-05 default baud rate
delay(1000);
}
@omfaer
omfaer / arduinoBluetoothConnection.java
Last active August 18, 2020 12:41
Connect Android to Arduino. Handler..
void getData() throws IOException {
String msg = "1";
msg += "\n";
mBluetoothSocket.getOutputStream().write(msg.toString().getBytes());
}
void beginListenForData() {
final Handler handler = new Handler();
final byte delimiter = 10; //This is the ASCII code for a newline character
@omfaer
omfaer / arduinoBluetoothConnection.ino
Last active August 18, 2020 12:41
Connect Android to Arduino
int incomingByte;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
if (incomingByte == '1') {
@omfaer
omfaer / database.rules.json
Created February 4, 2020 11:53 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@omfaer
omfaer / GradientTextView.java
Last active October 24, 2019 06:45
Android GradientTextView Trick
/**GradienTextView Trick
* Cited From Rahul Chowdhury
* https://blog.upcurve.co/how-to-create-a-gradient-textview-in-android-c21331da86ab
**/
import android.content.Context;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatTextView;
def fib(n)
if n == 1
puts 0
else
fib = [0,1]
(n-2).times do
fib << fib[-1] + fib[-2]
end
puts fib.join(' ')
end
/*
Created by omfaer for [Pidecik](https://github.com/omfaer/Pidecik)
[Pidecik Generate Script](https://gist.github.com/omfaer/afc664374c674cd2d4295d0a8a79cab6)
*/
USE Pidecik
GO
DELETE FROM CategoryProduct
DELETE FROM CustomerOrder
DELETE FROM OrderPersonel
DELETE FROM OrderProduct
USE [master]
GO
/****** https://github.com/omfaer/Pidecik
------------------------------
How To?
1.Install SQL Server
2.You need to change the "YOUR_FILE_PATH" with your database file path.
3.Execute this script
-That's all
------------------------------