Skip to content

Instantly share code, notes, and snippets.

View netoisc's full-sized avatar
🏠
Working from home

Ernesto netoisc

🏠
Working from home
View GitHub Profile
@netoisc
netoisc / ESClient_Test.cs
Created June 26, 2017 16:10
How to test ElasticClient with Moq and .net
[Test]
public async Task ElasticClient_Test()
{
var people = new List<Person>
{
new Person { Id = 1 },
new Person { Id = 2 },
};
var hits = new List<IHit<Person>>
@netoisc
netoisc / script_startup.conf
Created July 28, 2017 18:31
How to create a startup script to run python script within virtualenv
description "Start the sos server as service"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid ubuntu
# try 2 times every 10 seconds then stop it if the exec fail
respawn limit 2 10
@netoisc
netoisc / rm_vmware_file.text
Created May 19, 2018 19:13
Remove vmware locked file
# How to delete a vmware file that was locked or corrupted
1. reboot mac
2 Cmd + R -> to recovery mode
3. From utilities, open the terminal
4. diskutil list -> to identity the main OS volume
5. diskutil unlockVolume <volumenIdentifier>
6. ls /Volumes to ensure our volume appear
7. goto to to /Macintosh HD/Users/<username>/Documents/Virtual Machines.localized/Windows 10 x64.vmwarevm
8. rm -fr <directoryOrfileWith.LckExtension>
@netoisc
netoisc / index.js
Created July 2, 2018 16:52
Create a simple react js bootstrap to use redux & redux-form
// index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { reducer as formReducer } from 'redux-form';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
@netoisc
netoisc / shapeArea.js
Created December 18, 2018 16:55 — forked from proustibat/shapeArea.js
We will define an n-interesting polygon. Your task is to find the area of a polygon for a given n.
const shapeArea = n => Math.pow( n, 2 ) + Math.pow( n - 1, 2 );
@netoisc
netoisc / reduce.js
Created April 8, 2019 19:29
Get object with sum of positives and negatives numbers with ES6
// hints
// ES6 rest params
// arrow function
const sum = (...args) =>
args.reduce((accu, value) => ({
positive: value > 0 ? accu.positive + value: accu.positive,
negative: value < 0 ? accu.negative + value: accu.negative,
}), { positive: 0, negative: 0})
// tests
@netoisc
netoisc / migrate_nbgrader_sqlite.py
Created September 25, 2020 19:26
Migrate NBgrader sqlite database to postgres
from nbgrader.api import Gradebook
import petl as etl
import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import sqlite3
db_name= 'nb_database'
db_user= 'illumidesk'
db_pwd= 'illumidesk.'
db_host= 'illumidesk_db_instance'
@netoisc
netoisc / docker-compose.yml
Created November 22, 2022 01:26 — forked from cmackenzie1/docker-compose.yml
Docker Compose for DynamoDB Local and Admin UI
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
@netoisc
netoisc / ainstall.md
Created August 10, 2025 18:01 — forked from burkeholland/ainstall.md
Boost

Boost Prompt

A prompt to boost your lazy "do this" prompts. Install with one of the buttons below.

Install in VS Code Install in VS Code Insiders

Use