View clearContents.gs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @OnlyCurrentDoc */ | |
clearTransactions(3, 1, 6, 6, true); | |
function clearTransactions(nHeaderRows, nHeaderColumns, nAccountsPerSection, nRowsPerDay, DEBUG = false) { | |
// BEGIN https://stackoverflow.com/a/21231012/2925434 | |
function columnToLetter(column) { | |
var temp, letter = ''; | |
while (column > 0) { |
View webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require( 'path' ); | |
const ForkTsCheckerWebpackPlugin = require( 'fork-ts-checker-webpack-plugin' ); | |
module.exports = { | |
// generate source maps | |
devtool: 'source-map', | |
// bundling mode | |
mode: 'production', |
View tryWIthResources.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait SourceUtils { | |
/** | |
* Opens a `resource`, passes it to the given function `f`, then | |
* closes the resource, returning the value returned from `f`. | |
* | |
* Example usage: | |
* {{{ | |
* val myString: String = | |
* using(scala.io.Source.fromFile("file.name")) { source => |
View music.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.awwsmm | |
import javax.sound.sampled.{AudioFormat, AudioSystem, SourceDataLine} | |
// Inspired by https://community.oracle.com/tech/developers/discussion/1273219/example-code-to-generate-audio-tone | |
// and https://stackoverflow.com/questions/1932490/java-generating-sound/47916383 | |
// still some "crackling" / "popping" at the end of the tune, but most of the way there | |
object Main extends App { |
View another-example.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.typed.Behavior | |
import akka.actor.typed.scaladsl.Behaviors | |
object Test extends App { | |
sealed trait AnimalCommand | |
sealed trait DogCommand extends AnimalCommand | |
object Bark extends DogCommand |
View gotta_click.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
ui <- basicPage( | |
actionButton("theButton", "gotta click"), | |
verbatimTextOutput("theNumber") | |
) | |
server <- function(input, output, session) { | |
vals <- reactiveValues(counter = 0) | |
View 🤯.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is a type class | |
trait Eq [A] { | |
def === (x: A)(y: A): Boolean | |
def =/= (x: A)(y: A): Boolean | |
} | |
// it is a reasonable translation of this Haskell code (Wiki) | |
// class Eq a where | |
// (==) :: a -> a -> Bool | |
// (/=) :: a -> a -> Bool |
View clickableValueBoxModule.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define the UI of the module | |
clickableValueBoxUI <- function(id) { | |
# create the namespace | |
ns <- NS(id) | |
# define the UI components | |
fluidRow( | |
valueBoxOutput(ns("my_valueBox")) | |
) |
View modalModule.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define the module UI | |
moduleUI <- function(id) { | |
# create the namespace from the id | |
ns <- NS(id) | |
# As this is a function, the last statement will be the return value. | |
# Make sure it contains all of the UI elements you want to display | |
fluidPage( |
View array_contains.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#------------------------------------------------------------------------------- | |
# | |
# array_contains - returns 0 if array contains the specified value, else 1 | |
# | |
# $1 : term to search for | |
# $2+ : array to inspect | |
# | |
# sources: |
NewerOlder