Skip to content

Instantly share code, notes, and snippets.

View rzfzr's full-sized avatar
🏍️
Riding

Rafael Figueira Goncalves rzfzr

🏍️
Riding
  • Clicnet
  • Doesn't matter
View GitHub Profile
@soygul
soygul / youtube-upload.js
Last active May 3, 2024 13:41
YouTube video uploader using JavaScript and Node.js
// YouTube API video uploader using JavaScript/Node.js
// You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s
// You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs
//
// Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs
const fs = require('fs');
const readline = require('readline');
const assert = require('assert')
const {google} = require('googleapis');
@laidbackware
laidbackware / gist:65ee73cf2c3e26e77187dcf060e57984
Last active November 6, 2023 11:39
VSCode Remtee SSH with GCP Instance

Install VSCode - https://code.visualstudio.com/download Install Remote-SSH plugin inside VSCode from the extensions page

Linux/Mac

  1. If you have the GCP SDK installed on your local machine
    1. Run the following

      gcloud compute config-ssh
      Record the hostname it provides as an the SSH example.
      E.g. $ ssh jumpbox.us-central1-a.pal4pe-1109-mproud

@huozhi
huozhi / simulate_mouse_action.js
Created March 31, 2019 14:14
simulate click and hover mouse action on web with js
const mouseEventOf = (eventType) => (element, x, y) => {
const rect = element.getBoundingClientRect()
const event = new MouseEvent(eventType, {
view: window,
bubbles: true,
cancelable: true,
clientX: rect.left + x,
clientY: rect.top + y,
})
/**********************
* fordingTheRiver.js *
**********************
*
* And there's the river. Fortunately, I was prepared for this.
* See the raft on the other side?
*
* Everything is going according to plan.
*/
@kbumsik
kbumsik / ipad_monitor.sh
Last active March 28, 2024 17:12
Using iPad as a 2nd monitor on Linux with VNC.
#!/bin/bash
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <k.bumsik@gmail.com> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. - Bumsik Kim
# ----------------------------------------------------------------------------
# Configuration
WIDTH=1024 # 1368 for iPad Pro
import * as admin from 'firebase-admin'
import * as fft from 'firebase-functions-test'
const ft = fft()
import * as sinon from 'sinon'
import { makeUppercase, addMessage } from './function'
describe('order', () => {
describe('makeUpperCase', () => {
it('should upper case input and write it to /uppercase', async () => {
const fakeSnaphost = ft.firestore.makeDocumentSnapshot({
@adcreare
adcreare / npm-beta-publish.md
Last active April 29, 2024 19:21
npm publish a beta package

Steps to publish a npm package to beta that won't be available via latest and won't auto install on ncu updates etc

  1. Ensure any compile is run npm run dist etc
  2. Modify version in package.json to the following format (match with existing verion numbers etc) "version": "0.1.120-beta.1" where beta.x is the number of those betas
  3. Publish to npm npm publish --tag beta

There are two options for install:

  • Always install beta with npm install packagename@beta
  • Install specific version with npm install package@0.1.120-beta.1
@louisvalet
louisvalet / Colors
Last active November 17, 2020 09:35
I heard you needed colors
using UnityEngine;
public static class Colors
{
public static readonly Color AbsoluteZero = new Color32( 0, 72, 186, 255 );
public static readonly Color Acajou = new Color32( 76, 47, 39, 255 );
public static readonly Color AcidGreen = new Color32( 176, 191, 26, 255 );
public static readonly Color Aero = new Color32( 124, 185, 232, 255 );
public static readonly Color AeroBlue = new Color32( 201, 255, 229, 255 );
public static readonly Color AfricanViolet = new Color32( 178, 132, 190, 255 );
@mauroa
mauroa / mqttclient
Created June 29, 2017 12:38
System.Net.Mqtt client sample
//Note that you can set more properties and also not set the port,
//in which case the MQTT default will be used
var configuration = new MqttConfiguration { Port = 55555 };
//Creation of the MQTT client
var client = await MqttClient.CreateAsync("192.168.1.29", configuration);
//MQTT connection of the client. You can pass optional args to the
//ConnectAsync method and credentials
await client.ConnectAsync(new MqttClientCredentials("testClient"));
@abritinthebay
abritinthebay / consoleColors.js
Last active April 26, 2024 00:33
The various escape codes you can use to color output to StdOut from Node JS
// Colors reference
// You can use the following as so:
// console.log(colorCode, data);
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
//
// ... and so on.
export const reset = "\x1b[0m"
export const bright = "\x1b[1m"
export const dim = "\x1b[2m"