Skip to content

Instantly share code, notes, and snippets.

View arma7x's full-sized avatar
🎯
Focusing

Ahmad Malik arma7x

🎯
Focusing
  • PayPal ahmadmuhamad101@gmail.com
  • MY
View GitHub Profile
/*
WiFi Web Server LED Blink
A simple web server that lets you blink an LED via the web.
This sketch will print the IP address of your WiFi Shield (once connected)
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the LED on pin 5.
If the IP address of your shield is yourAddress:
http://yourAddress/H turns the LED on
let headers = document.getElementsByTagName('header') || []
for (var x in headers) {
headers[x].remove ? headers[x].remove() : ''
}
let footers = document.getElementsByTagName('footer') || []
for (var x in footers) {
footers[x].remove ? footers[x].remove() : ''
}
let banners = document.getElementsByClassName('banner') || []
for (var x in banners) {
const qr = ((_) => {
let _status = false;
let video;
let intv;
let start_scan = function (callback) {
window_status = "scan";
bottom_bar("", "", "");
document.getElementById("qr-screen").style.display = "block";
@arma7x
arma7x / gist:ebaf0a7747ce05e70d887061a542f198
Last active June 4, 2021 11:50
KaiOS Youtube Scrapper
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; // https://www.npmjs.com/package/xmlhttprequest
var X2JS = require("x2js"); // https://www.npmjs.com/package/x2js
var deparam = require("deparam"); // https://www.npmjs.com/package/deparam
var xhr = function(method, url, data={}, query={}, headers={}) {
return new Promise((resolve, reject) => {
var xhttp = new XMLHttpRequest({ mozSystem: true });
var _url = new URL(url);
for (var y in query) {
_url.searchParams.set(y, query[y]);
@arma7x
arma7x / todoist.js
Last active April 1, 2021 18:07
ToDoist Rest Api for KaiOS[WIP]
const Todoist = (function() {
function Todoist(options, onComplete) {
this.syncData = {};
this.onComplete = onComplete != null && typeof onComplete === "function" ? onComplete : null;
this.init(options);
}
Todoist.prototype.init = function(options, onComplete) {
this.accessToken = options.access_token;
@arma7x
arma7x / DataStorage.js
Created November 4, 2020 03:33
KaiOS File Manager
const DataStorage = (function() {
const SDCARD = navigator.getDeviceStorage('sdcard');
function DataStorage(onChange) {
this.init(onChange);
}
DataStorage.prototype.init = function(onChange) {
this.trailingSlash = '';
@arma7x
arma7x / radiogrp.js
Created October 13, 2020 11:16
radiogrp.js
import React from 'react'
import ReactDOM from 'react-dom'
import RadioBtn from './radiobtn'
class RadioGrp extends React.Component {
componentDidMount() {
document.activeElement.addEventListener('keydown', this.handleKeydown);
const items = document.querySelectorAll('.items');
console.log('Items - ', items)
import React, { Component } from 'react'
import { Button, Modal } from 'react-bootstrap';
import { RadioGroup, RadioButton } from 'react-radio-buttons';
import RadioOptions from './radiooptions'
class Page4 extends Component {
componentDidMount() {
document.addEventListener('keydown', this.handleKeydown);
const items = document.querySelectorAll('.items');
@arma7x
arma7x / app_arma.js
Last active August 24, 2020 10:31 — forked from sreelash/app_arma.js
window.addEventListener("load", function() {
console.log("Loaded screen updated")
var deviceFound;
var writeCharacteristic;
var readCharacteristic;
if (navigator.mozBluetooth !== undefined) {
console.log("Not undefined")
window.addEventListener("load", function() {
var deviceFound;
if (navigator.mozBluetooth !== undefined) {
navigator.mozBluetooth.onattributechanged = function() {
console.log('onattributechanged');
}