Skip to content

Instantly share code, notes, and snippets.

View cagataycali's full-sized avatar

./c² cagataycali

View GitHub Profile
@cagataycali
cagataycali / Flipper_Zero_JS_Cheat_Sheet.md
Created July 19, 2024 22:02
A comprehensive cheat sheet for developing JavaScript code on the Flipper Zero, including examples and explanations for various functionalities like GPIO usage, BadUSB, BLE Beacon, UART, USB Disk Emulation, Sub-GHz communication, Textbox, Submenu, Notifications, Storage, and additional menus. This cheat sheet is designed to streamline the coding…

Flipper Zero JavaScript Cheat Sheet

General Structure

  • Path and File Information:
    print("Script path:", __filepath);
    print("Script directory:", __dirpath);

GPIO Usage

@cagataycali
cagataycali / readme.md
Last active March 12, 2024 20:19
Run multimodal llm (llava with llamafile) and open browser after the model start.

Install

[wget ... or download](https://gist.github.com/acaa476865821b02813b8a8e88e59c13.git)
chmod +x run-local-multimodal-llm-openai-compatible.sh
./run-local-multimodal-llm-openai-compatible.sh
@cagataycali
cagataycali / [email protected]
Created January 15, 2023 02:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@cagataycali
cagataycali / [email protected]
Created January 15, 2023 02:51
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@cagataycali
cagataycali / [email protected]
Created December 20, 2022 15:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@cagataycali
cagataycali / index.html
Last active August 1, 2022 20:30
HSTP.html
<html></html>
@cagataycali
cagataycali / README.md
Last active July 31, 2022 16:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
@cagataycali
cagataycali / index.html
Last active November 25, 2021 02:36
[HTML + CSS + JS] Simple auto complete
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Auto Complete</title>
<style>
#container {
width: 200px;
@cagataycali
cagataycali / auto-complete.js
Created November 24, 2021 08:28
[Trie] Prefix tree for find auto complete suggestions
class Node {
constructor(char) {
this.char = char;
this.children = new Map(); // It's limited by 26 chars, hashmap.
this.isEndWord = false;
}
}
class Trie {
constructor() {
this.root = new Node("");
@cagataycali
cagataycali / throttle.js
Created November 24, 2021 04:08
[JavaScript] throttle
function throttle (callback, limit) {
var waiting = false; // Initially, we're not waiting
return function () { // We return a throttled function
if (!waiting) { // If we're not waiting
callback.apply(this, arguments); // Execute users function
waiting = true; // Prevent future invocations
setTimeout(function () { // After a period of time
waiting = false; // And allow future invocations
}, limit);
}