Skip to content

Instantly share code, notes, and snippets.

View nicolasdanelon's full-sized avatar
🖖
live long and prosper

Nicolas Danelon nicolasdanelon

🖖
live long and prosper
View GitHub Profile
@nicolasdanelon
nicolasdanelon / .zshrc
Created January 24, 2022 23:26
script not working on .zshrc file
function myMacStatus()
system_profiler_cache=$(system_profiler SPPowerDataType)
battery_cicles=$(echo $system_profiler_cache | grep 'Cycle Count' | awk '{print $3}')
battery_charge=$(echo $system_profiler_cache | grep 'State of Charge' | awk '{print $5}')
battery_condition=$(echo $system_profiler_cache | grep 'Condition' | awk '{print $2}')
echo "\n"
# echo "Life used by SSD: $(smartctl -a disk0 | grep 'Percentage Used' | awk '{print $3}')"
echo Battery cycles: $battery_cicles
@nicolasdanelon
nicolasdanelon / user.php
Last active April 25, 2022 15:50
user.php
// https://www.wikiwand.com/es/SOLID
// Service Repository Pattern
class User {
private string $name;
}
class UserRepository {
public function getUserName(int $id): string
{
import React, { Component } from 'react';
class App extends React {
constructor(props) {
super(props);
this.state = {
liveRequest: false,
};
}

Keybase proof

I hereby claim:

  • I am nicolasdanelon on github.
  • I am nicolasdanelon (https://keybase.io/nicolasdanelon) on keybase.
  • I have a public key whose fingerprint is 8AAD 8815 360E 8776 BF11 3A07 7983 32C6 65A5 51BB

To claim this, I am signing this object:

@nicolasdanelon
nicolasdanelon / nginx-example.com.conf
Created April 12, 2019 20:19 — forked from akirattii/nginx-example.com.conf
Typical example of nginx (v1.10.3) conf file for using ssl and collaboration with nodejs app
# nginx conf file example in the case of using:
# - nodejs app server
# - letsencrypt for SSL
# version: nginx/1.10.3
# /etc/nginx/conf.d/example.com.conf
# Permits for tester to access even if web server is under maintenance:
geo $allow_ip_flag {
default 0; # Not Allowed
@nicolasdanelon
nicolasdanelon / store.js
Created August 14, 2018 13:12 — forked from FMCorz/store.js
Fallback on cache when Axios reports a network error
import Axios from 'axios';
import { setupCache } from 'axios-cache-adapter';
import exclude from 'axios-cache-adapter/src/exclude';
// Define the cache adapter.
const cacheAdapter = setupCache({
clearOnStale: false,
});
const getKey = cacheAdapter.config.key;
@nicolasdanelon
nicolasdanelon / arr.js
Created July 17, 2018 14:36
moment - meses abreviados en español - shot months spanish
import moment from 'moment';
import momentEs from 'moment/locale/es';
moment.updateLocale(momentEs);
const monthsShort = ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'];
moment.updateLocale('es', { monthsShort: m => (m ? monthsShort[m.month()] : monthsShort) });
@nicolasdanelon
nicolasdanelon / app.js
Last active June 15, 2018 17:35
super calculadora
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
first: 0,
second: 0,
.plinth
display: block
width: 0
height: 0
border-style: solid
&.p-hero
position: absolute
z-index: 50
bottom: 0
@nicolasdanelon
nicolasdanelon / cirujana.php
Last active October 2, 2023 21:19
type of cirujana
<?php
use App\valueObjects\tipoPersona;
class cirujana extends personaNormal {
public function __construct($paramVisual, $paramMoral): void
{
parent::construct();
}