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 / 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

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:

import React, { Component } from 'react';
class App extends React {
constructor(props) {
super(props);
this.state = {
liveRequest: false,
};
}
@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
{
@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 / install-arch.sh
Created April 25, 2022 15:47
Quick and simple guide - ArchLinux install
timedatectl set-ntp true
fdisk /dev/sda
o
n
p
1
+300M
a
n
p
@nicolasdanelon
nicolasdanelon / docker-compose.yml
Created April 27, 2022 16:11
docker compose -> kafka - zookeeper - postgres - pgadmin
version: "2"
services:
zookeeper:
image: docker.io/bitnami/zookeeper:3.8
ports:
- "2181:2181"
volumes:
- "zookeeper_data:/bitnami"
environment:
@nicolasdanelon
nicolasdanelon / Cargo.toml
Created July 26, 2022 19:49
problem line 23
[package]
name = "rust-json"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
@nicolasdanelon
nicolasdanelon / kill-firebase-emu-switch.sh
Created December 5, 2022 13:30
Dead simple script for kill processes (firebase emulators) by port, blazingly fast
#!/bin/bash
for i in 9001 8086 8081
do
lsof -i tcp:$i | head -n 2 | tail -n 1 | awk '{print $2}' | xargs kill
done
pacman -S --needed xorg sddm i3 i3-wm i3lock i3status feh dmenu rofi firefox kitty the_silver_searcher vim htop ttf-fira-mono ttf-hack ttf-joypixels ttf-ubuntu-font-family
yay -y i3blocks i3-gaps
systemctl enable sddm
cat ~/.config/i3/config
mkdir ~/.config/i3/i3status
cp /etc/i3status.conf ~/.config/i3/i3status/default.conf