2D, 3D, game, games, online game, game development, game engine, programming, OpenGL, Open AI, math, graphics, design, graphic, graphics, game development, game engine, programming, web development, web art, web graphic, arts, tutorial, tutorials,
joi, 20 noiembrie 2025
News : Microsoft added support for @ollama to PowerToys 0.96
... according to x.com - ollama:
Microsoft added support for @ollama to PowerToys 0.96
Now you can use Ollama for advanced clipboard management. Transform your clipboard content into any format you need! (paste content as plaintext, markdown, JSON, or various file formats.).
All this can run locally!
Google Apps Script : keep sheets whose names include today’s date ...
Today, this simple example will keep sheets whose names include today’s date in flexible regex formats
The script not include the month names (e.g., “20-Nov-2025”)
On running keeps sheets whose names contain any of these combinations; deletes the rest.
Let's see the source code:
function deleteSheetsWithoutToday() {
// Get today's components (zero-padded and variants)
var now = new Date();
var tz = Session.getScriptTimeZone();
var dd = Utilities.formatDate(now, tz, "dd"); // e.g., "20"
var d = Utilities.formatDate(now, tz, "d"); // e.g., "20" (no leading zero if <10)
var mm = Utilities.formatDate(now, tz, "MM"); // e.g., "11"
var m = Utilities.formatDate(now, tz, "M"); // e.g., "11" (no leading zero if <10)
var yyyy = Utilities.formatDate(now, tz, "yyyy"); // e.g., "2025"
var yy = Utilities.formatDate(now, tz, "yy"); // e.g., "25"
// Build a regex that matches many possible date embeddings in the sheet name
var dateRegex = buildFlexibleDateRegex({ dd: dd, d: d, mm: mm, m: m, yyyy: yyyy, yy: yy });
// Active spreadsheet
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var kept = 0;
var deleted = 0;
sheets.forEach(function(sheet) {
var name = sheet.getName();
// If the name contains a combination of today's date components (any of the supported formats), keep it
if (dateRegex.test(name)) {
kept++;
Logger.log("KEEP: " + name);
} else {
ss.deleteSheet(sheet);
deleted++;
Logger.log("DELETE: " + name);
}
});
Logger.log("Summary → Kept: " + kept + ", Deleted: " + deleted);
}
/**
* Build a flexible regex that matches today's date in common formats.
* It covers:
* - dd[sep]mm[sep](yyyy|yy)
* - mm[sep]dd[sep](yyyy|yy)
* - (yyyy|yy)[sep]mm[sep]dd
* - (yyyy|yy)[sep]dd[sep]mm
* - contiguous forms like ddmmyyyy, mmddyyyy, yyyymmdd, ddmmyy, etc.
* - allows multiple separator types: -, _, ., /, space, colon
* - accepts zero-padded and non-padded day/month (e.g., "7" or "07")
*/
function buildFlexibleDateRegex(parts) {
var dd = parts.dd; // zero-padded day
var d = parts.d; // non-padded day
var mm = parts.mm; // zero-padded month
var m = parts.m; // non-padded month
var yyyy = parts.yyyy;
var yy = parts.yy;
// Separator class: one or more of -, _, ., /, space, or colon
var SEP = "[\\-_.\\/\\s:]+";
// Day and month alternatives (padded or not)
var DAY = "(?:" + dd + "|" + d + ")";
var MONTH = "(?:" + mm + "|" + m + ")";
var YEAR = "(?:" + yyyy + "|" + yy + ")";
// Ordered patterns with separators
var withSeps = [
DAY + SEP + MONTH + SEP + YEAR, // dd-mm-yyyy or dd/mm/yy, etc.
MONTH + SEP + DAY + SEP + YEAR, // mm-dd-yyyy
YEAR + SEP + MONTH + SEP + DAY, // yyyy-mm-dd
YEAR + SEP + DAY + SEP + MONTH // yyyy-dd-mm
];
// Contiguous patterns (no separators)
var noSeps = [
dd + mm + yyyy,
dd + mm + yy,
mm + dd + yyyy,
mm + dd + yy,
yyyy + mm + dd,
yy + mm + dd
];
// Optional surrounding non-digit boundaries to avoid matching inside longer numbers
// We’ll use word boundaries plus lookarounds to be more permissive with symbols.
var prefix = "(?<!\\d)"; // no digit before
var suffix = "(?!\\d)"; // no digit after
// Combine all patterns into a single alternation
var combined =
prefix +
"(?:" +
withSeps.join("|") +
"|" +
noSeps.join("|") +
")" +
suffix;
// Make the regex case-insensitive and global
return new RegExp(combined, "i");
}
Posted by
Cătălin George Feștilă
Labels:
2025,
google,
Google Apps Script,
open source,
source code,
tutorial,
tutorials
News : Redot 4.4 rc-1 is now live! in XR technology.
Create your 2D and 3D games, cross-platform projects, or explore innovative ideas in XR technology with Redot Engine!
Read more on the official blogger or see videos on RedotEngine - the official youtube channel.
News : ... new beta features on blogger !
**Try our New Beta Features**: Create a more engaging reading experience with the help of Google
Google Search previews: Easily insert visual Google Search previews for popular people, locations, pop-culture and more directly in your blog! In Compose View, look for the ‘G’ button in the editor tool bar to get started.
Blogger was launched on August 23, 1999 by Pyra Labs, founded by Evan Williams.
In the early 2000s, Blogger grew quickly as one of the first platforms to make blogging accessible to everyone.
Blogger experienced rapid growth, becoming one of the first platforms to make blogging widely accessible.
In 2003, Google acquired Blogger and integrated it into its services, offering free hosting under blogspot.com.
Later, it faced strong competition from WordPress and other modern CMS platforms, which reduced its market share.
In 2010, Google ended FTP publishing and centralized all blogs on its own servers.
After 2010, Blogger saw a relative decline as WordPress and other modern CMS platforms rose in popularity and captured much of the market.
In 2025, Google introduced new beta features for Blogger, showing that the platform has not been abandoned. These experimental tools aim to modernize Blogger, adding visual elements and creating a more engaging reading experience for users.
Abonați-vă la:
Comentarii (Atom)