Skip to content

Instantly share code, notes, and snippets.

@theely
theely / INSTRUCTIONS
Last active August 1, 2022 17:42
ngrok service for Raspberry Pi
1) set-up ngrok
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
ngrok config add-authtoken <your token here>
2) install ssmtp
sudo apt install ssmtp
3) crate /etc/init.d/ngrok
4) crate /home/pi/.config/ngrok/ngrok.yml
5) create a gmail app password to be used in the sendNgrokAddress.py file
6) crate /home/pi/sendNgrokAddress.py
7) set-up ngrok service
@theely
theely / gist:071844902c9868cd5478194311e24df6
Created March 1, 2021 07:25
Behavioural Consistency - Testing Script
-- Testing Script to meause Behavioural Consistency
-- Credits to: Mactac for creating the original script
-- Instruction to install and run the script: https://youtu.be/tocH6IgbK7k
tricks = {{}, {}, {}}
-- Flip
tricks[1][1] = {200,800,0,0,0} -- Throttle bust {time,throttle,yaw,roll,pitch}
tricks[1][2] = {35,-1024,0,256,0} -- flip {time,throttle,yaw,roll,pitch}
@theely
theely / Ender-3 End G-code
Last active September 7, 2021 05:43
Ender-3 Start & End G-codes
G91 ; Relative positioning
G1 E-5 F3000 ; Retract a bit
G1 E-10 X5 Y5 Z5 F3000 ; Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
@theely
theely / GPSLog.lua
Last active February 14, 2021 13:20
Rolling GPS latlong logging. Stores the latest 100 distinct latlong coordinates (redundant coordinates are ignored). Coordinates are stored in: /LOGS/GPS_rolling_positions.log. Logging is paused if less than 4 satellites are available.
-- License https://www.gnu.org/licenses/gpl-3.0.en.html
-- OpenTX Lua script
-- FUNCTION
-- Place this file in SD Card > /SCRIPTS/FUNCTIONS/
-- Author: Elia P.
-- Date: 2019 November 02
-- Description
@theely
theely / GPSLog.lua
Created November 2, 2019 22:39
Rolling GPS latlong logging
-- Rolling GPS latlong logging
-- Stores the latest 100 distinct latlong coordinates (redundant coordinates are ignored).
-- If the number of sats is smaller than 4 coordinates are not recorded.
-- requires GPS telemetry
local function rnd(v,d)
if d then
return math.floor((v*10^d)+0.5)/(10^d)
else
@theely
theely / 01_switch_configuration.js
Created January 31, 2018 14:08
A cordova hook script
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
function replace_string_in_file(filename, to_replace, replace_with) {
var data = fs.readFileSync(filename, 'utf8');
@theely
theely / container-css
Last active September 13, 2017 19:24
sticky-html
.header{
position: fixed;
top: 0px;
width: inherit;
z-index: 2;
background: #252830;
}
@theely
theely / sticky-container
Last active October 13, 2017 05:42
sticky-header-container
import { Component, OnInit, Input,OnChanges, ElementRef,HostListener } from '@angular/core';
import {SectionComponent} from '../section/section.component';
@Component({
selector: 'container',
templateUrl: './container.component.html',
styleUrls: ['./container.component.css']
})
export class ContainerComponent implements OnInit {
@theely
theely / sticky-section
Last active September 13, 2017 19:23
A angular2 component skeleton to implement a section sticky header
import {Component, OnInit, ElementRef, Output, EventEmitter, HostListener,Input,Output } from '@angular/core';
@Component({
selector: 'section',
templateUrl: './section.component.html',
styleUrls: ['./section.component.css']
})
export class SectionComponent implements OnInit {
{
"name": "raw-data-table-preview",
"version": "0.0.1"
}