This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simple dimmer controlled with buttons | |
Sarverott @ 2023 | |
https://gist.github.com/Sarverott/3b352c6c3fe1c3d13f3faf642cc3b23c | |
this project ingredients: | |
- digispark board { | |
ATtiny85 :: [ Flash memory = 8kb ; frequency = 16MHz ] | |
Board operational voltage = 5V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result=[]; | |
document.querySelectorAll(".table-container table tr").forEach(function(x){ | |
var currentRow=[]; | |
x.childNodes.forEach(function(y){ | |
if(y.nodeType==1){ | |
currentRow.push(y.innerText) | |
} | |
}) | |
result.push(currentRow); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int randomSound, delayPeriod; | |
void setup() { | |
} | |
void loop() { | |
delayPeriod=random(1,10); | |
for(int pin=0;pin<6;pin++){ | |
randomSound=random(20,1000); | |
noTone(pin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Sett Sarverott @ 2017 | |
rem image-renamer.bat [from-directory-path] [to-directory-path] [extension-without-dot] | |
rem ### | |
rem example of use: START /w /b .\image-renamer.bat E:\path\from\camera-files-with-long-names E:\path\to\camera-files-with-long-names jpg | |
dir /b "%1" >".\_picture-list.txt" | |
set picturecounter=1 | |
pause | |
:g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $(cat "$1" |grep "print " -c) == 0 ]; | |
then | |
python2 "$1"; | |
else | |
python3 "$1"; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
usefull in new study groups if your uniwersity email is based on "firstname.lastname@university.domain.net" pattern, go to: | |
https://classroom.google.com/r/{ id of your classroom }/sort-last-name | |
inspect in devtools in browser one name of student, should be <span class="y4ihN YVvGBb">.... | |
paste code it into console | |
*/ | |
const CSS_SELECTOR_TARGET=prompt("insert css selector of all name fields", "span.y4ihN.YVvGBb"); | |
const COLEDGE_MAIL_POSTFIX=prompt("insert students emails postfix", "@edu.your-colledge.pl"); | |
console.log( | |
Array.from( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
template<typename V> void varPrint(char *name, V x, int len){ | |
V xT[len], *xX=xT; | |
cout | |
<<name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EXECUTE: help | pipetest "dest.txt" | find "HELP" | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]){ | |
char tmpBuff=0; | |
while(argc-->0){ | |
cout<<"\t"<<(argv++)<<endl; | |
} | |
while(cin.good()){ | |
if(cin.get(tmpBuff))cout.put(tmpBuff); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eventSearch(searchQuery="*", searchEvent=false){ | |
var out=Array.from( | |
document.querySelectorAll(searchQuery) | |
); | |
out=out.map(function(element){ | |
const events=getEventListeners(element); | |
if(Object.keys(events).length!==0&&(!searchEvent||Object.keys(events).includes(searchEvent))){ | |
var itemQuery=element.nodeName; | |
if( | |
typeof element.id=="string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;asmWorm - self-replication code in assembler for Intel 8080 | |
;Sett Sarverott @ 2022 | |
lxi h, 0000h ;start read | |
lxi d, 002fh ;stop read/start write | |
mvi c, 2fh ;length | |
mvi a, 00h ;index | |
replicator: | |
;copy this code to space after this code | |
mov b, m ;b=*read_pointer | |
xchg |