Skip to content

Instantly share code, notes, and snippets.

View corlaez's full-sized avatar
🏠
WFH since January 2020

Armando Cordova corlaez

🏠
WFH since January 2020
View GitHub Profile
@corlaez
corlaez / gist:4ab35d4383f6fb7a09a0e972920b8106
Created May 12, 2020 18:26
Notes for local dev jitsi-meet
# Open terminal where you want to create the jitsi sources folders and run:
# Download sources
git clone https://github.com/jitsi/jitsi-meet.git
# enter project folder
cd jitsi-meet
# make sure you have node version 12 or higher. Check it with
node -v
# If it is not 12.x.x or higher you should stop, and install the right version of node.
# Now install the npm packages
@corlaez
corlaez / cd_key.vbe
Last active January 31, 2020 18:59 — forked from setuix/cd_key.vbe
How to Find and Save Your Windows 10 Product Key
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
@corlaez
corlaez / README.md
Created December 27, 2019 00:17
Batch file to check stored passwords.
@corlaez
corlaez / mixin.js
Created September 27, 2019 23:42
Hooks predecesors
import React from "react";
var MyMixin = {
componentDidUpdate() {
this.componentMethod()
},
mixinMethod() {}
};
const MyComponent = React.createClass({
function merge(l1, l2) {
const se = new Set(l1);
l2.forEach(e => se.add(e))
return [...se]
}
const x = Object.keys(old).reduce((acc, cur) => {
acc[cur] = merge(old[cur], neww[cur]);
return acc
}, {})
@corlaez
corlaez / runme
Created August 7, 2019 14:30
Killing processes using a given port unix. Runs in terminal
netstat -ano | findstr :PORT
taskkill /PID_NUMBER /F
netstat -ano | findstr 3000
taskkill /9052 /F
@corlaez
corlaez / useMousePosition.ts
Created July 23, 2019 23:17
useMousePosition react hook
import { useState, useEffect } from 'react'
export const useMousePosition = () => {
const [position, setPosition] = useState({ x: 0, y: 0 });
useEffect(() => {
const setFromEvent = (e: any) => setPosition({
x: e.clientX,
y: e.clientY
});
window.addEventListener("mousemove", setFromEvent);
@corlaez
corlaez / overmindGists.ts
Created July 23, 2019 23:16
Overmind snapshots of different files of a project. Just to get a feel of it.
/* state.ts
* Here we define the initial state of the application.
* I have ommited the types for Newspapers, Table and State for brevity.
*/
export const state: State = {
table: {
selected: null,
newspapers: [],
},
}
@corlaez
corlaez / db.js
Created July 23, 2019 22:29
A mysql wrapper that will allow to make simple read operations
const mysql = require('mysql2')
const createConnection = (connectedCB) => {
const envParams = {
host: process.env.host,
user: process.env.user,
password: process.env.password,
database: process.env.database,
}
if (Object.keys(envParams).some(k => envParams[k] == null)) {