Skip to content

Instantly share code, notes, and snippets.

View rmanalan's full-sized avatar
:octocat:

Rich Manalang rmanalan

:octocat:
View GitHub Profile
@zanona
zanona / sentry-serverless-firebase.ts
Last active April 3, 2024 15:48
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';
@muralikg
muralikg / background.js
Last active June 8, 2023 09:19
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active March 19, 2024 18:16
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 23:35
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@sperand-io
sperand-io / iframeSnippet.html
Last active January 6, 2022 22:56
Using Segment via iFrame Communication
<script>
/**
* Provides a fake analytics object that sends all calls to the parent window for processing
*/
var analytics = (function() {
var eventQueue = [];
// Send the events to the frame if it's ready.
function flush(method, args) {
while (eventQueue.length) {
@rbergman
rbergman / ccs.sh
Created January 8, 2013 18:02
Compile CoffeeScript files to JavaScript and send the result to stdout, with optional line numbers.
#!/bin/bash
if [ "$#" == "0" ]; then
echo "Usage: ccs [-n] file1 ... fileN"
echo "Compiles CoffeeScript files to JavaScript and emits the result to stdout."
echo " -n prepend line numbers"
exit 1
fi
if [ "$1" == "-n" ]; then
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@ladyada
ladyada / raspi-gmail.py
Created July 6, 2012 19:16
Raspberry Pi LED E-mail Notifier
cat <<! > raspi-gmail.py
#!/usr/bin/env python
import RPi.GPIO as GPIO, feedparser, time
DEBUG = 1
USERNAME = "username" # just the part before the @ sign, add yours here
PASSWORD = "password"
@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off