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 / 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 / ArduinoCode.ino
Last active June 14, 2020 20:14 — forked from slayerjay/ArduinoCode.ino
Arduino and Python Serial Connection with LCD . UPDATED . (https://www.instructables.com/id/Wiring-up-the-LCD-and-the-LED/)
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("start");
@adegard
adegard / reportTemplate.html
Created March 21, 2020 16:10 — forked from mhawksey/reportTemplate.html
Grabbing full text from urls and creating a .doc/html from a template using Google Apps Script
function doGet(e){
// get some variables passed from the querystring
var project = e.parameter.title;
var range = e.parameter.range;
var sheet = e.parameter.sheet;
// Grab a basic html template to fill in the blanks - see https://developers.google.com/apps-script/html_service
var t = HtmlService.createTemplateFromFile("reportTemplate");
// some bits of code to grab the source urls
var doc = SpreadsheetApp.openById(ScriptProperties.getProperty('active'));
@adegard
adegard / suona.vbs
Created February 16, 2020 17:12 — forked from andcar72/suona.vbs
Esegue un suono (solo wav?) tramite vbs
Set oVoice = CreateObject("SAPI.SpVoice")
set oSpFileStream = CreateObject("SAPI.SpFileStream")
oSpFileStream.Open "C:\Windows\startup.wav"
oVoice.SpeakStream oSpFileStream
oSpFileStream.Close
@adegard
adegard / Sleep - Pause in VBS.vbs
Created February 16, 2020 16:43 — forked from kevinguyer/Sleep - Pause in VBS.vbs
Sleep - Pause in VBS
' So simple, so elegant, so elusive. Behold its glory:
' ------------------------------------------------------------------
Sub wait_function(secs)
Dim enter_time, leave_time
enter_time = Timer
leave_time = Timer
While (enter_time + secs > leave_time)
leave_time = Timer
@adegard
adegard / AdbCommands
Created January 19, 2020 17:16 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.