Skip to content

Instantly share code, notes, and snippets.

View rudimusmaximus's full-sized avatar
🎯
Chillin!!!

raul flores jr rudimusmaximus

🎯
Chillin!!!
View GitHub Profile
@rudimusmaximus
rudimusmaximus / classFreeSample.js
Last active February 16, 2021 16:10
GDG Lightning Talk 2020.06.11 Class Free code see comments for presentation link
/**
* 'class free' object constructor for a simple counter that counts up or down
*
* @param {Object} Spec - generic object for member destructuring-assignments
* @param {String} Spec.runBy - name of person using the constructor
* @returns {{up: Function, down: Function, toJSON: Function}}
*/
function counter_constructor(Spec) {
let {
runBy = 'John Doe', // default value if not specified
@tanaikech
tanaikech / submit.md
Last active February 2, 2024 09:54
Updated Specification of Google Spreadsheet: Multiple Hyperlinks to a Cell

Updated Specification of Google Spreadsheet: Multiple Hyperlinks to a Cell

Recently, it seems that the specification of Google Spreadsheet was updated. Before this, when a cell has only one hyperlink. In this case, the hyperlink was given to a cell using =HYPERLINK("http://www.google.com/", "Google") as following figure.

But by the recent update, a cell got to be able to have multiple hyperlinks as following figure. In this case, the hyperlinks are set by the RichTextValue object.

@tanaikech
tanaikech / submit.md
Last active November 19, 2022 06:08
Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script

Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script

This is a sample script for retrieving values from filtered Sheet in Spreadsheet using Google Apps Script. When the values are retrieved the filtered sheet by the basic filter, if setValues() and setDisplayValues() are used, all values without the filter are retrieved. In this script, I would like to introduce the method for retrieving the values from the filtered sheet using Google Apps Script.

In order to retrieve the values from the filtered sheet, one method has already been proposed. That method retrieved the values from the filtered sheet by retrieving columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API. In this case, the rows and columns hidden by the filter can be retrieved.

In this sample script, columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API are not used. The values are directly retrieved.

Spreadsheet

@meigwilym
meigwilym / CQRS.md
Last active May 9, 2024 14:35
CQRS, Task Based UIs, Event Sourcing agh!

CQRS, Task Based UIs, Event Sourcing agh!

Posted by gregyoung on February 16, 2010

Many people have been getting confused over what CQRS is. They look at CQRS as being an architecture; it is not. CQRS is a very simple pattern that enables many opportunities for architecture that may otherwise not exist. CQRS is not eventual consistency, it is not eventing, it is not messaging, it is not having separated models for reading and writing, nor is it using event sourcing. I want to take a few paragraphs to describe first exactly what CQRS is and then how it relates to other patterns.

CQRS Command and Query Responsibility Segregation

Starting with CQRS, CQRS is simply the creation of two objects where there was previously only one. The separation occurs based upon whether the methods are a command or a query (the same definition that is used by Meyer in Command and Query Separation, a command is any method that mutates state and a query is any method that returns a value).

@uogbuji
uogbuji / pixelbook-dev-setup.md
Last active May 17, 2024 00:35 — forked from cassiozen/pixelbook-dev-setup.md
Notes on setting up Pixelbook for development

Pixelbook or Pixel Slate Setup

Partly updated June 2023

General caution: Chrome OS is a secure OS by design, but this has at least one key consequence. If you change your Google account password, you will still be required to enter the old password the next time you access each Chrome OS device. Devices are encrypted with that password, so the OS needs to decrypt using the old password then re-encrypt using the new one. If you forget your old password you will lose access to your Chrome OS device data. As always, make sure you keep backups up to date.

Fast User Switching

If you have multiple Chrome OS accounts (Say, work and play), you can quickly sitch between them without logging out:

@schabibi1
schabibi1 / fallthrough_objects_alternative.js
Created February 12, 2019 22:01
JavaScript: Is Fallthrough From Switch Statement A Troublemaker?
let description = {
"Yoda" : "Jedi",
"Anakin" : "Jedi",
"Obi-One" : "Jedi",
"Luke" : "Jedi",
"Ray" : "Jedi",
"Finn" : "Jedi",
"Kylo Ren" : "Jedi",
"Chewbacca" : "Wookiee",
"R2-D2" : "Astromech droid",
/**
* Takes a google maps api key and
* a json props object to generate
* a valid URL to a static map image.
* 
* @returns a valid URL to static map image
*/
function getStaticMap(key, props) {
 const markers = (props.markers || []).map(marker => 
@gaearon
gaearon / minification.md
Last active June 8, 2024 08:15
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@gaearon
gaearon / modern_js.md
Last active June 11, 2024 07:33
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@tanaikech
tanaikech / submit.md
Last active July 26, 2023 17:00
Benchmark: Loop for Array Processing using Google Apps Script without V8

Benchmark: Loop for Array Processing using Google Apps Script without V8

April 16, 2018 Published.

July 26, 2018 Updated. Result of reduce was added.