Skip to content

Instantly share code, notes, and snippets.

View meddulla's full-sized avatar

Sofia meddulla

  • Cloudflare
  • Portugal
View GitHub Profile
@meddulla
meddulla / runDevBrowser.mjs
Created January 16, 2024 15:02 — forked from SomeHats/runDevBrowser.mjs
A hacky local version of cloudflare's browser rendering API. To use this, copy either runDevBrowser.ts or runDevBrowser.mjs and install the puppeteer and ws packages from npm. Run the dev server alongside wranger with `node runDevServer.mjs` or `tsx runDevServer.ts`
/* eslint-disable no-console */
/***
* This is a little server that emulates the protocol used by cloudflare's browser rendering API. In
* local development, you can run this server, and connect to it instead of cloudflare's (strictly
* limited) API. e.g. in your worker you might use a function like this:
*
* ```ts
* import { Browser, launch as launchPuppeteer } from '@cloudflare/puppeteer'
* function launchBrowser(env: Environment) {
* if (env.LOCAL_BROWSER_ORIGIN) {
@meddulla
meddulla / calc.asm.js
Created November 9, 2020 16:24 — forked from thatisuday/calc.asm.js
A simple asm.js module
function Calc(stdlib, foreign, heap) {
"use asm";
function add(a, b) {
a = a|0;
b = b|0;
return (a + b)|0;
}
return {
add: add
};
@meddulla
meddulla / bsdgames-osx.rb
Created October 20, 2020 14:54 — forked from jdmartin/bsdgames-osx.rb
A homebrew formula for installing bsdgames-osx (updated for macOS Sierra). For now, just plunk it into /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bsdgames-osx.rb (or, put it in ~/.homebrew/Library/Formula/ and specify this path when installing) and run "brew install bsdgames-osx". Tested successfully with MacOS X 10.12.3.
require 'formula'
class BsdgamesOsx < Formula
desc 'The classic bsdgames of yore for Mac OS X and macOS.'
homepage 'https://github.com/ctdk/bsdgames-osx'
url 'https://github.com/ctdk/bsdgames-osx/archive/bsdgames-osx-2.19.3.tar.gz'
sha256 '699bb294f2c431b9729320f73c7fcd9dcf4226216c15137bb81f7da157bed2a9'
head 'https://github.com/ctdk/bsdgames-osx.git'
version '2.19.3'
depends_on "bsdmake" => ':build'
@meddulla
meddulla / Dockerfile
Created May 13, 2020 10:08 — forked from dceejay/Dockerfile
Dockerfile for Node-RED
# Dockerfile for Node-RED - pulls latest master code from git
# Use the node.js v4 LTS engine
FROM node:4-slim
MAINTAINER ceejay
RUN mkdir -p /root/.node-red
WORKDIR /root/.node-red
# download latest stable node-red
RUN npm install -g --unsafe-perm node-red
@meddulla
meddulla / bigquery_notes.md
Created June 17, 2019 08:17 — forked from robcowie/bigquery_notes.md
Biquery Notes

Biqquery Notes

Require a partition filter on an existing table

bq update --require_partition_filter --time_partitioning_field ts -t page_impressions.raw

Copy a table

@meddulla
meddulla / example.plantuml
Last active December 2, 2017 12:47 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@meddulla
meddulla / vm-resize-hard-disk.md
Last active November 11, 2017 17:33 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@meddulla
meddulla / ehcache.xml
Created August 23, 2017 13:24 — forked from oscarrenalias/ehcache.xml
A better ehcache.xml configuration file for the Play Framework, which out of the box limits the size of the cache based on the number of objects you put in it rather than the number of bytes. I personally think that's not a very smart choice. Also see http://ehcache.org/documentation/2.5/configuration/cache-size#cache-configuration-sizing-attrib…
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false">
<!-- This is a default configuration for 256Mb of cached data using the JVM's heap, but it must be adjusted
according to specific requirement and heap sizes -->
<defaultCache
maxBytesLocalHeap="256000000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
@meddulla
meddulla / croc-hunter.sh
Created June 20, 2017 16:56 — forked from etoews/croc-hunter.sh
Rough notes on getting this "Zero to Kubernetes CI/CD in 5 minutes with Jenkins and Helm" demo https://www.youtube.com/watch?v=eMOzF_xAm7w running on MS Azure Container Service.
# https://github.com/Microsoft/azure-docs/blob/master/articles/container-service/container-service-kubernetes-walkthrough.md
alias az="docker run --rm --volume ${HOME}:/root azuresdk/azure-cli-python az"
az login
RESOURCE_GROUP=kubernetes
LOCATION=southcentralus
DNS_PREFIX=phymata
CLUSTER_NAME=kubernetes
object Monoids {
trait Semigroup[A] {
def add(x: A, y: A): A
}
trait Monoid[A] extends Semigroup[A] {
def zero: A
}