Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Aristide Bouix ArisBee

🎯
Focusing
View GitHub Profile
@ArisBee
ArisBee / delete-vals.gs
Last active Dec 17, 2017
Google App Script function looking for a list of values from a sheet column in another sheet column and deleting the corresponding lines.
View delete-vals.gs
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
@ArisBee
ArisBee / is-in-range.gs
Created Dec 17, 2017
A Google App Script function (javascript) to check if an IP address belongs to a given range.
View is-in-range.gs
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 / SNOWsimpleAuth.gs
Created Mar 2, 2018
Simple password ServiceNow API authentication in Google script.
View SNOWsimpleAuth.gs
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 / shit.js
Created Jul 13, 2018
Javascript HarlemShake
View shit.js
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 / MouseWiggle.ps1
Created Sep 24, 2020
Move your mouse while away
View MouseWiggle.ps1
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)
}
}