Skip to content

Instantly share code, notes, and snippets.

View B45i's full-sized avatar
:octocat:

Amal Shajan B45i

:octocat:
View GitHub Profile
@B45i
B45i / build.yml
Created November 13, 2021 15:09
GitHub Action - Build Ionic Capacitor Android app
name: Build Android
on: [push, pull_request]
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout source
@B45i
B45i / MCU Movies in Chronological Order with Straming Links.md
Last active January 9, 2022 20:39
MCU Movies in Chronological Order with Straming Links
@B45i
B45i / Tiny_PoV.ino
Last active June 18, 2021 11:56
PoV Display code for ATTiny13
#define DELAY_TIME 2
#define CHAR_BREAK 5
uint8_t leds[] = { 0, 1, 2, 3, 4 };
uint8_t keys[] = { 1, 2, 4, 8, 16 };
void setup() {
for (uint8_t i = 0; i < 5; i++) {
pinMode(leds[i], OUTPUT);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.container {
width: 80%;
background-color: #ddd;
const delayPromise = (timeout) =>
new Promise((resolve) => setTimeout(resolve, timeout));
setInterval(() => {
let btns = Array.from(
document.querySelectorAll('.sqdOP.L3NKy.y3zKF')
).filter((btn) => btn.innerText.toLowerCase() === 'follow');
(btns || []).forEach(async (btn) => {
btn.click();
@B45i
B45i / main.py
Last active March 1, 2019 15:21
Micro python news display
import network
import urequests
import time
import machine
import ssd1306
i2c = machine.I2C(scl=machine.Pin(4), sda=machine.Pin(5))
oled = ssd1306.SSD1306_I2C(128, 64, i2c)
URL = 'http://newsapi.org/v2/top-headlines?sources=the-verge&apiKey=374fb9f276c24901a6c74c82f7bc4d68'

pip install esptool

esptool.py --port /dev/ttyUSB0 erase_flash esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20190125-v1.10.bin

esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flash esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32-20190125-v1.10.bin

import esp
@B45i
B45i / arduino-cli.sh
Last active May 22, 2022 18:06
Arduino-cli initial setup
.cli-config.yml
board_manager:
additional_urls:
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
arduino-cli core update-index
arduino-cli core install esp8266:esp8266
@B45i
B45i / DateStrings.cs
Last active July 5, 2018 11:46
C# Exercises
// Exercise - 4 - Date and Strings
using System;
using System.Collections.Generic;
using System.Text;
namespace CSharpTask
{
class DateString
{
@B45i
B45i / primes.py
Created May 25, 2018 13:01
Python list containing first 10,000 prime numbers
primes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
467, 479, 487, 491, 499, 503, 509, 521, 523, 541,