Skip to content

Instantly share code, notes, and snippets.

View gpincheiraa's full-sized avatar

Gonzalo Pincheira Arancibia gpincheiraa

View GitHub Profile
@gpincheiraa
gpincheiraa / README.md
Created August 8, 2024 14:35
Tarea Programación ejemplo

intro-dev-lab-04

Introducción al Valor Absoluto

El valor absoluto de un número se refiere a su magnitud sin tener en cuenta su signo. Es decir, es la distancia que hay entre el número y el cero en la recta numérica. Se denota como (|n|), donde (n) es cualquier número real. El valor absoluto siempre es un número no negativo.

Por ejemplo, el valor absoluto de (-3) es 3, porque la distancia entre (-3) y 0 en la recta numérica es 3. Del mismo modo, el valor absoluto de (3) es también 3, ya que está a la misma distancia de 0, pero en la dirección opuesta.

Ejemplo: Encontrar la distancia entre dos números utilizando el valor absoluto

@gpincheiraa
gpincheiraa / rename_js_files.sh
Created April 4, 2022 21:34 — forked from afternoon/rename_js_files.sh
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@gpincheiraa
gpincheiraa / config.yml
Last active November 5, 2019 10:05
ngChile-09-11-2019-circle-ci-config
version: 2.1
aliases:
restore_cache: &restore_cache
restore_cache:
name: Restore Npm Package Cache
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
save_cache: &save_cache
save_cache:
@gpincheiraa
gpincheiraa / app.component.html
Created April 14, 2019 20:18
working-frontend-with-stubby_src/app/app.component.html
<router-outlet></router-outlet>
@gpincheiraa
gpincheiraa / app-routing.module.ts
Created April 14, 2019 20:14
working-frontend-with-stubby_src/app/app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { AccountBalanceComponent } from './pages/account-balance/account-balance.component';
import { ProfileComponent } from './pages/profile/profile.component';
import { AuthenticatedGuard } from './services/authenticated.guard';
const routes: Routes = [
{
path: '',
@gpincheiraa
gpincheiraa / todo.service.spec.js
Created October 8, 2017 00:18
todo.service.spec.js-2nd-article
import { TodoService } from "services/todo.service"
describe("TodoService", () => {
let TodoServiceInstance
beforeEach(() => {
const $http = {
get: jest.fn()
}
const BASE_URL = "http://localhost:5000/todos"
TodoServiceInstance = new TodoService($http, BASE_URL)
@gpincheiraa
gpincheiraa / todos_get.json
Created September 25, 2017 02:40
todos_get.json_1_2nd_article
{
"todos": [
{
"name": "Learn Programming using component based approach",
"completed": true
},
{
"name": "Learn Machine Learning",
"completed": false
},
@gpincheiraa
gpincheiraa / fakeserver.yml
Created September 25, 2017 02:35
fakeserver.yml_1_2nd_article
- request:
url: ^/api/todos
response:
headers:
content-type: application/json
status: 200
file: todos_get.json
@gpincheiraa
gpincheiraa / package.json
Last active October 8, 2017 00:31
package.json_2_2nd_article
{
"name": "angularjs-tdd-jest",
"version": "0.1.0",
"scripts": {
"server": "webpack-dev-server",
"start": "npm-run-all -p stubs server",
"stubs": "stubby -w -d stubs/fakeserver.yml -s 5000",
"tdd": "cross-env NODE_PATH=./src jest --watch --verbose",
"test": "cross-env NODE_PATH=./src jest --coverage --verbose"
},
@gpincheiraa
gpincheiraa / todoList.component.js
Created September 23, 2017 06:21
todoList.component.js_1_2nd_article
class TodoListController {
addTodo(todo){
this.todosList.push(todo)
}
toggleCheckTodo(index){
this.todosList[index].completed = !this.todosList[index].completed
}
deleteTodo(index){
this.todosList.splice(index, 1)
}