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 / gist:ba9777d57320e772716c2121ea68dc1a
Last active December 2, 2019 08:46
Changing Select values as "A", for each select in page that has "id" starts with "g_"
[].forEach.call(
document.querySelectorAll('select[id^="g_"]'),
function(select) {
select.value = 'A';
}
)
@roberto-butti
roberto-butti / main.yml
Last active December 16, 2023 23:43
GitHub Actions workflow for Laravel (automated test)
name: Laravel
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
laravel-tests:
@roberto-butti
roberto-butti / grid_lat_lng_geojson.js
Last active July 2, 2019 10:53
JS script without dependencies to generate a geojson file with a grid for latitude and longitude
var geojson = {};
geojson.type = "FeatureCollection";
var features = [];
const step = 1;
var i=0;
var feature = {};
for(i=-180;i<=180;i=i+step){
feature = {};
@roberto-butti
roberto-butti / .editorconfig
Created December 27, 2018 08:59
.editorconfig
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
{
"features": [
{
"geometry": {
"coordinates": [
12.4246,
45.5658
],
"type": "Point"
},
@roberto-butti
roberto-butti / Roberto_s_Workout.zwo
Created March 29, 2018 19:37
Roberto's Workout
<workout_file>
<author>Roberto</author>
<name>Roberto&apos;s Workout</name>
<description>Pump up the Volume</description>
<sportType>bike</sportType>
<tags>
</tags>
<workout>
<SteadyState Duration="300" Power="0.5"/>
<SteadyState Duration="180" Power="0.65"/>
@roberto-butti
roberto-butti / prova.solidity
Last active May 28, 2018 13:32
Sample Solidity file
pragma solidity ^0.4.19;
// 1. Import here
import "./ownable.sol";
// 2. Inherit here:
contract ZombieFactory is Ownable {
event NewZombie(uint zombieId, string name, uint dna);
uint dnaDigits = 16;
@roberto-butti
roberto-butti / gist:852735dc8a42f11b15b9e21935adc7d4
Created February 17, 2018 20:08
Prompt for ZShell (with hostname, username, path and git info)
PROMPT='%{$fg_bold[green]%}%n @ %{$fg_bold[white]%}%M %{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
@roberto-butti
roberto-butti / lara_top.php
Created February 11, 2018 17:12
Laravel will be over the top!!!
<?php
$opts = [
'http' => [
'method' => 'GET',
'header' => [
'User-Agent: PHP Laravel will be over the TOP'
]
]
];
$context = stream_context_create($opts);
{
"years": [2006],
"0": [{
"year": "2006",
"name": "FRANCESCO",
"count": "10004",
"gender": "m",
"percent": "3.5204526899581"
}, {
"year": "2006",