Skip to content

Instantly share code, notes, and snippets.

View adegard's full-sized avatar
🎮
print("hello world!")

adegard adegard

🎮
print("hello world!")
  • Here
View GitHub Profile
@adegard
adegard / gist:0ccdb58ad530cae8069419dc635bba32
Created December 9, 2022 14:52 — forked from nicwolff/gist:1414689
Password generator bookmarklet (SGP)
javascript:var%20b64pad='';var%20chrsz=8;function%20b64_sha1(s)%7Breturn%20binb2b64(core_sha1(str2binb(s),s.length*chrsz));%7Dfunction%20core_sha1(x,len)%7Bx%5Blen%3E%3E5%5D%7C=0x80%3C%3C(24-len);x%5B((len+64%3E%3E9)%3C%3C4)+15%5D=len;var%20w=Array(80);var%20a=1732584193;var%20b=-271733879;var%20c=-1732584194;var%20d=271733878;var%20e=-1009589776;for(var%20i=0;i%3Cx.length;i+=16)%7Bvar%20olda=a;var%20oldb=b;var%20oldc=c;var%20oldd=d;var%20olde=e;for(var%20j=0;j%3C80;j++)%7Bif(j%3C16)w%5Bj%5D=x%5Bi+j%5D;else%20w%5Bj%5D=rol(w%5Bj-3%5D%5Ew%5Bj-8%5D%5Ew%5Bj-14%5D%5Ew%5Bj-16%5D,1);var%20t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w%5Bj%5D),sha1_kt(j)));e=d;d=c;c=rol(b,30);b=a;a=t;%7Da=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);e=safe_add(e,olde);%7Dreturn%20Array(a,b,c,d,e);%7Dfunction%20sha1_ft(t,b,c,d)%7Bif(t%3C20)return%20(b&c)%7C((~b)&d);if(t%3C40)return%20b%5Ec%5Ed;if(t%3C60)return%20(b&c)%7C(b&d)%7C(c&d);return%20b%5Ec%5Ed;%7Dfunction%20sha1_kt(t)%7Bretur
@adegard
adegard / threeExample.html
Created June 17, 2021 11:58
threeExample.html
<!DOCTYPE html>
<html lang="en">
<head>
<style>
html, body {
margin: 0;
height: 100%;
}
@adegard
adegard / index.css
Created June 16, 2021 19:20
Three.js - Fundamentals
/*bug-in-github-api-content-can-not-be-empty*/
@adegard
adegard / randomWalk.js
Last active May 18, 2021 18:57
Random walk colored
//https://editor.p5js.org/adegard/present/FaaJjJpXw
let x;
let y;
function setup() {
createCanvas(600, 600);
x = width / 2;
y = height / 2;
background(10);
@adegard
adegard / gist:47cbec26aa4b7377d50e8c5cd0194923
Last active January 8, 2021 13:14 — forked from gesteves/gist:1051628
Google Apps script to export Google Talk chat logs to a Google Docs spreadsheet
/*
Quick instructions:
1. Go to Google Sheet and open a new spreadsheet.
2. Go to Tools > Script editor...
3. Delete everything, paste this code in the script editor, and save it.
4. Go back to the spreadsheet, Tools > Script manager...
5. Select getChats, and press the "run" button.
6. It'll ask for a bunch of authorizations. Grant them.
7. When it says "now you can run the script", repeat step 5.
@adegard
adegard / read_file&TTS.vbs
Created July 30, 2020 06:56
vbs Task speak aloud from txt file
' Task speak aloud.
' create a routine for your gscript to a txt file like "C:\tmp\file.txt"
' (see https://gist.github.com/adegard/1a7583baa8cf6b422ce4d2ee04b015ec)
' this vbs will read it when it contains something
' To start automatically on logon, put into the directory that opens on:
' Win+R: Open: [shell:startup] -> [OK]
' (C:\Users\YOU\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)
' adegard, 2020, v1.0
Option Explicit
@adegard
adegard / writeTotext.gs
Last active July 30, 2020 06:57
gs write text file in gdrive, by gscript (eg. gsheet)
/*
, . ,-. , ,---. ,--.
| . | | ) | | |
| ) ) |-< | | |-
|/|/ | \ | | |
' ' ' ' ' ' `--'
,---. . , ,---.
| \ / |
| X |
@adegard
adegard / pomodoro.vbs
Created July 23, 2020 08:26
vbs Pomdoro timer . make a little break . Notification
' Pomdoro timer . make a little break . Notification VBS
' To start automatically on logon, put into the directory that opens on:
' Win+R: Open: [shell:startup] -> [OK]
' (C:\Users\YOU\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)
'set brightness based on day hour
Dim mytimer
mytimer = 50 'min
@adegard
adegard / calibrationSensor.ino
Last active July 18, 2020 16:03
Soil Moisture sensor calibration Arduino ESP 32
/*
// Calibration Capacitive Soil Moisture Sensor with ESP32
// use Serial Plotter of Arduino per determinare wet/dry values
// Reduse sensor tension to 1,63 volts : I used 2 resistors of 100 Ohms see diagram in post
// https://forum.micropython.org/viewtopic.php?t=4487
// 2020
*/
#include <Arduino.h> //for vscode
@adegard
adegard / mainMoisture.ino
Last active July 19, 2020 13:20
Soil Moisture ESP 32 Wifi
/*
// Capacitive Soil Moisture Sensor with ESP32 &write data on Thinspeak via Wifi
// 2020, v3.2
// tested on ESP WROOM 32 DEV KIT
// NOTE:
// use pin 32 (ADC2 only)
// ADC1 is used by wifi (see https://live.staticflickr.com/4764/40089095211_ec1fee0087_b.jpg)
// change apikey, adress of channel, wifi ssid and password below
// Calibration Capacitive Soil Moisture Sensor with ESP32
// use Serial Plotter of Arduino per determinare wet/dry values