Skip to content

Instantly share code, notes, and snippets.

View erm3nda's full-sized avatar
😑
Expressionless master

m3nda erm3nda

😑
Expressionless master
  • n0n3
  • localhost
View GitHub Profile
@erm3nda
erm3nda / javascript_bottom_alert.js
Created October 12, 2020 14:47
Javascript code to detect when we are at bottom of the scroll
window.onscroll = function() {
// @var int totalPageHeight
var totalPageHeight = document.body.scrollHeight;
// @var int scrollPoint
var scrollPoint = window.scrollY + window.innerHeight;
// check if we hit the bottom of the page
if(scrollPoint >= totalPageHeight)
@erm3nda
erm3nda / universal_blinking_led_arduino_example.ino
Created August 18, 2020 08:34
Arduino blinking led example but fixed to work also on boards with less PIN, ie attiny85 #arduino #c
#include <Arduino.h>
// Attiny85 doesn't have nor recognize LED_BUILTIN 13 from Arduino.h
// Little fix to enable led blink with a LED on PIN 3 + GND to test boards.
#ifndef LED_BUILTIN
#define LED_BUILTIN 3
#endif
void setup() {
// initialize digital pin LED_BUILTIN as an output.
@erm3nda
erm3nda / mpv-http-ipc-json-flask-interface.py
Created August 6, 2020 07:26
This code shows how to create an https interface and listen for queries, then filter and pass them to ipc server running locally #python #mpv
#!/usr/local/env python
# coding: utf8
from flask import Flask, jsonify, request
import os, subprocess
# La creación manual de certificados la reemplazo por ssl_context="adhoc" que está integrado en flask y funciona onthefly
# el problema del adhoc es que genera un nuevo cert cada vez que se lanza, y eso es un rollo si accedemos con un browser, por ejemplo
'''
@erm3nda
erm3nda / mpv-http-ipc-json-flask-bridge.py
Created August 6, 2020 04:52
This code shows how to create an https bridge with flask that sends json commands from network to json ipc server running locally #python #mpv
#!/usr/local/env python
# coding: utf8
from flask import Flask, jsonify, request, abort
import os, subprocess, json
ASSETS_DIR = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
@erm3nda
erm3nda / dual_screen_elantech.sh
Created July 24, 2020 22:36
Configure touchscreen area of touch device when having dual screen
# configure touchscreen area properly
pointer_id=`xinput | grep ELAN | cut -d " " -f30 | egrep -o '[0-9]{2}'`
xinput map-to-output $pointer_id eDP1
@erm3nda
erm3nda / x360 chinesses usb receiver install.md
Created July 23, 2020 17:38
Como instalar el receptor chino de Xbox 360 wireless en Win10
@erm3nda
erm3nda / init.sh
Last active July 22, 2020 18:02 — forked from ebuildy/init.sh
Setting PHP stream context from system env
echo "auto_prepend_file=/opt/www/proxy.php" >> /etc/php/php.ini
@erm3nda
erm3nda / kivy_install.bat
Created July 22, 2020 06:43
Install Kivy on Windows #python #kivy
pip install --upgrade pip wheel setuptools
pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
pip install kivy.deps.gstreamer
pip install kivy.deps.angle
pip install kivy
@erm3nda
erm3nda / remote-build
Last active June 28, 2020 02:18
Example of remote rsync and building with buildozer
#!/bin/bash
user=YOUR_REMOTE_USERNAME
host=YOUR_HOST_IP
folder=REMOTE_SUBFOLDER
server=$user@$host
# delete local and remote apk builds
rm bin/*
ssh $server rm $folder/bin/*
@erm3nda
erm3nda / roe_ads_helper.ahk
Last active January 20, 2021 03:54
Enables auto aiming (right click) by simply firing (left click)
; This enables auto aim when firing.
; Manual aim works as usual
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
enabled := True