Skip to content

Instantly share code, notes, and snippets.

View samthetechie's full-sized avatar

Samuel Carlisle samthetechie

View GitHub Profile
@samthetechie
samthetechie / index.mjs
Last active November 19, 2023 20:18 — forked from spersico/index.mjs
Liberating Huawei Notes "HTML" (actually JSON) to TXT
import { writeFile, readdir, readFile, mkdir } from 'node:fs/promises';
import path from 'node:path';
/*
Steps to get/export your notes from Huawei Notes:
1. Login into a Huawei Account in the phone.
2. Activate in your phone, the Notes Syncing, which is inside of Huawei Account > Cloud
3. Log in into https://cloud.huawei.com
4. Go to https://cloud.huawei.com/home#/account/gdpr, and click on Download Notes
5. This will give you a zip file with a password. Extract the zip file into a folder.
6. Copy this file into the root directory folder as index.mjs
@samthetechie
samthetechie / scrape_over_tor.py
Last active December 22, 2017 09:50
Simple Scraper written in Python using Requests. Randomised User Agent / request Requests through a socket / Tor socks proxy.
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Simple Scraper written using Requests.
Randomised User Agent / request
Requests through a socket / Tor socks proxy.
"""
from fake_useragent import UserAgent
@samthetechie
samthetechie / .bashrc
Created December 21, 2017 10:37
my ~/.bashrc functions for creating and deleting github repos, tested on Debian GNU/Linux 9.3 (stretch)
#Tested with OS: Debian GNU/Linux 9.3 (stretch) x86_64
#bash --version
#GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
#curl --version
#curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
# assumptions:
# 1) virtualenv and virtualenvwrapper are installed
# 2) github authentication using tokens
# 3) python2.7 default for new projects
@samthetechie
samthetechie / pyfolia.py
Created August 8, 2014 18:46
Scrapes myFolia crowdsourced data in order to generate and import a geometrically representative cylinder of a mature plant, perhaps a vegetable or fruit into a google sketchup 3d stage.
# fn plant_gen(x, y, z, height, width, name,[latin name] )
# scrapes myFolia crowdsourced data in order to generate and import a geometrically representative cylinder of a mature plant, perhaps a vegetable or fruit into a google sketchup 3d stage.
# defaults:
# height (cm or inches)
# width (cm or inches)
# name (title case)
# Output: creates cylinders to represent the envelope of a vegetable or fruit plant in google sketchup
# diameter of the cylinder is == width, height
#
# {x, y, z} is the position in model space for the base of the cylinder.
@samthetechie
samthetechie / de.po
Last active August 29, 2015 14:02
Drupal 7 English to German translation of modules/locale/locale.datepicker.js
# German translation of modules/locale/locale.datepicker.js
# Import into -> German
# Text Group: Built-in interface
#: modules/locale/locale.datepicker.js
msgid "Monday"
msgstr "Montag"
#: modules/locale/locale.datepicker.js
msgid "Tuesday"
@samthetechie
samthetechie / index.js
Created October 30, 2012 17:21 — forked from max-mapper/index.js
twitter bot for @sandyaid retweets
var crypto = require('crypto')
var request = require('request')
var url = require('url')
var irc = require('./IRC/lib/irc')
var ntwitter = require('ntwitter')
var twitter = require('twitter')
var qs = require('querystring')
// separate accounts to post and search because twitter was sending me 500s
// when I tried to use the same oauth creds for both twitter() and ntwitter()
@samthetechie
samthetechie / TRTL.pde
Created September 8, 2011 23:13
TRTL Testing Code for H-Bridge Control of Motors
#define EN_1_2 12
#define EN_3_4 7
#define INPUT_1A 11
#define INPUT_2A 10
#define INPUT_4A 8
#define INPUT_3A 9
void setup()
{
pinMode(EN_1_2, OUTPUT);