Skip to content

Instantly share code, notes, and snippets.

View ArisBee's full-sized avatar
🎯
Focusing

Aristide Bouix ArisBee

🎯
Focusing
View GitHub Profile
@ArisBee
ArisBee / MouseWiggle.ps1
Created September 24, 2020 09:32
Move your mouse while away
function MouseWiggle {
Add-Type -Assembly System.Windows.Forms
while($True) {
Start-Sleep -Seconds 1
[Windows.Forms.Cursor]::Position = New-Object Drawing.Point (random 1000),(random 1000)
}
}
@ArisBee
ArisBee / shit.js
Created July 13, 2018 22:39
Javascript HarlemShake
1. Go to Google Chrome
2. Go to any website (works cool on facebook)
3. Right click anywhere -> Inspect Element
4. Click on the rightmost "Console" tab.
5. Copy paste the following * into the console.
6. Make sure the volume isn't too loud!
6. Press Enter.
* Copy paste the following text in the console:
@ArisBee
ArisBee / SNOWsimpleAuth.gs
Created March 2, 2018 15:01
Simple password ServiceNow API authentication in Google script.
function SNOWsimpleAuth() {
// Those are environnement variables defined in File>Project properties>Script properties
var username = PropertiesService.getScriptProperties().getProperty('LOGIN');
var password = PropertiesService.getScriptProperties().getProperty('PASSWORD');
// I will use Google script UrlFetchApp class to make request, which is more powerfull than XMLHttpRequest
var headers = {
'Authorization': 'Basic ' + Utilities.base64Encode(username + ":" + password)
};
@ArisBee
ArisBee / is-in-range.gs
Created December 17, 2017 22:45
A Google App Script function (javascript) to check if an IP address belongs to a given range.
function isInRange(ip, firstRangeIp, lastRangeIp)
{
var ipArr = ip.split(".");
var firstArr = firstRangeIp.split(".");
var lastArr = lastRangeIp.split(".");
var pos = 0
for(i=0;i<4;i++)
{
@ArisBee
ArisBee / delete-vals.gs
Last active December 17, 2017 22:48
Google App Script function looking for a list of values from a sheet column in another sheet column and deleting the corresponding lines.
function checker () {
// Delete all the row associated to a list of values contained in an other sheet
var sss = SpreadsheetApp.openById('X'); // Replace X with spreadsheet ID
var ts = sss.getSheetByName('sheet1'); // Replace sheet1 with destination Sheet tab name
var ss = sss.getSheetByName('sheet2'); // Replace sheet2 with source Sheet tab name
var startRowTS = 1; // First row of data to process in Sheet1
var startRowSS = 1; // First row of data to process in Sheet2
var numRowsTS = ts.getLastRow() ; // Number of rows to process destination table