Skip to content

Instantly share code, notes, and snippets.

View roberto-butti's full-sized avatar
🚀

Roberto Butti roberto-butti

🚀
View GitHub Profile
@roberto-butti
roberto-butti / realtime-component.blade.php
Created March 20, 2021 11:12
Websocket with livewire
<div wire:onmessage="msg_type_1">
Current time: {{ now() }}
</div>
@roberto-butti
roberto-butti / nginx_virtualdomain.conf
Created February 14, 2021 20:12
Virtual Domain configuration in /etc/nginx/sites-available/
server {
listen 80;
listen [::]:80;
# SSL configuration
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
# Set root directive with your /public Laravel directory
root /var/www/ghygen.hi-folks.dev/htdocs/public;
# Set index directive with index.php
index index.php;
@roberto-butti
roberto-butti / node-cache.yml
Created February 6, 2021 09:14
snippet for githubactions workflow with node_modules caching
name: Test Laravel Github action
on:
push:
branches:
- main
- develop
- features/**
jobs:
laravel-tests:
@roberto-butti
roberto-butti / RollTheDice.jsx
Last active January 27, 2021 13:20
RollTheDice component
import React, { useState, useEffect } from 'react';
function RollTheDice() {
// 001 : declare a new state variable, "dice" to track the current roll.
const [dice, setNumber] = useState(0);
// 002 : declare a new state variable, "rolls" to track all rolls.
const [rolls, setRolls] = useState([]);
// 003 : implementing useEffect hook in order to change the title of the page on every changes of value of dice.
@roberto-butti
roberto-butti / en.json
Created December 20, 2020 08:25
Laravel Jetstream Livewire, translation file
{
"Dashboard": "Dashboard",
"Manage Account": "Manage Account",
"Profile": "Profile",
"API Tokens": "API Tokens",
"Manage Team": "Manage Team",
"Team Settings": "Team Settings",
"Create New Team": "Create New Team",
"Switch Teams": "Switch Teams",
"Logout": "Logout",
@roberto-butti
roberto-butti / git_command.sh
Created March 30, 2020 06:51
Some git command
# short git log: Comment, Date, Author
git log --pretty=format:'%s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@roberto-butti
roberto-butti / here_account_oauth1.php
Last active January 11, 2021 12:55
Testing Oauth1 call
<?php
require __DIR__ . "/../vendor/autoload.php";
/**
* Thanks to clear documentation:
* https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a/creating-a-signature
*
*/
@roberto-butti
roberto-butti / jsconfig.json
Created January 20, 2020 11:07
jsconfig.json
{
"compilerOptions": {
"target": "ES6"
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
@roberto-butti
roberto-butti / resize.sh
Created December 3, 2019 13:22
Resize image max 64px
for i in $(ls -1 public/assets/img/markers/*.png);do convert $i -resize 64x64\> $(basename $i) ;done
@roberto-butti
roberto-butti / APPROVE TIMESHEET
Last active December 20, 2019 14:24
Click all images in the web page, with the id that begins with "approve_img_"
[].forEach.call(
document.querySelectorAll('img[id^="approve_img_"]'),
function(select) {
select.click();
}
)