Skip to content

Instantly share code, notes, and snippets.

View matiasvallejosdev's full-sized avatar
🎯
Focusing

Matias Vallejos matiasvallejosdev

🎯
Focusing
View GitHub Profile
@kuc-arc-f
kuc-arc-f / app.js
Created January 18, 2022 02:31
Serverless Framework express, prisma (mysql) sample
const serverless = require('serverless-http');
const express = require('express');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const app = express();
app.use('/', indexRouter);
app.use('/users',usersRouter);
module.exports = app;
@amrrs
amrrs / avoid_colab_close.js
Created August 17, 2021 20:02
How to avoid Google Colab Session Closing automatically?
//credit - https://huggingface.co/blog/fine-tune-wav2vec2-english (Patrick von Platen)
// run this on your Chrome / Browser Console (where Colab is present)
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
var colab = setInterval(ConnectButton,60000);
@matiasvallejosdev
matiasvallejosdev / Singlenton.cs
Created January 20, 2021 23:38
Singleton Class for Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Singlenton<T> : MonoBehaviour where T : Singlenton<T>
{
// Generic Class with T = Tipo de variable
private static T instance;
public static T Instance
{
@nikhilkumarsingh
nikhilkumarsingh / ddbocal.ipynb
Last active May 7, 2021 23:40
AWS DynamoDB Local
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import boto3
def main():
# 1 - Create Client
ddb = boto3.resource('dynamodb',
endpoint_url='http://localhost:8000',
region_name='dummy',
aws_access_key_id='dummy',
aws_secret_access_key='dummy')
# 2 - Create the Table
ddb.create_table(TableName='Transactions',
@gvvynplaine
gvvynplaine / .gitignore
Last active January 25, 2022 19:58
jupyter notebook gitignore
# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/
.ipynb_checkpoints
*/.ipynb_checkpoints/*
# IPython
profile_default/
ipython_config.py
@nicoavila
nicoavila / docker-compose.yml
Last active March 7, 2024 12:30
Docker Compose file for a MySQL 5.7 container
version: '3.3'
services:
database:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
// extension awaiter/methods can be used by this namespace
using UniRx.Async;
// You can return type as struct UniTask<T>, it is unity specialized lightweight alternative of Task<T>
// no(or less) allocation and fast excution for zero overhead async/await integrate with Unity
async UniTask<string> DemoAsync()
{
// You can await Unity's AsyncObject
var asset = await Resources.LoadAsync<TextAsset>("foo");
@vmandic
vmandic / dotnet core .gitignore
Last active July 18, 2024 09:03
A default .NET Core project .gitignore file - or just type `dotnet new gitignore`
# From .NET Core 3.0 you can use the command: `dotnet new gitignore` to generate a customizable .gitignore file
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
# Visual Studio Code
.vscode
@Fhernd
Fhernd / estadisticas-arreglo.py
Created February 15, 2018 00:10
Estadísticas básicas en Python con Numpy.
import numpy as np
arreglo_primos = np.array([2, 3, 7, 19, 23])
# Promedio:
print(np.mean(arreglo_primos))
print('')
# Mediana: