Skip to content

Instantly share code, notes, and snippets.

View simonewebdesign's full-sized avatar
🇺🇦
💙 💛

Simone Vittori simonewebdesign

🇺🇦
💙 💛
View GitHub Profile
@simonewebdesign
simonewebdesign / install_sublime_text.sh
Last active March 11, 2024 12:23
Install Sublime Text 3 on Linux via POSIX shell script - http://simonewebdesign.it/install-sublime-text-3-on-linux/
#!/bin/sh
# Sublime Text 3 Install (last update: Monday 13 March 2017)
#
# No need to download this script, just run it on your terminal:
#
# curl -L git.io/sublimetext | sh
# Detect the architecture
@simonewebdesign
simonewebdesign / install-quake3.sh
Last active November 14, 2023 19:25
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@simonewebdesign
simonewebdesign / ways.md
Created October 23, 2023 11:48
Ways to create multiple cursors in VSCodium (macOS)

Ways to create multiple cursors in VSCodium (macOS)

  • option+shift+drag
  • alt+click
  • cmd+opt+arrow up/down
@simonewebdesign
simonewebdesign / scroll.html
Last active October 8, 2023 15:32
Scrolling feature for a web chat, without using libraries.It behaves like Skype: if the user is way too far from the bottom, it just doesn't scroll, because the user may be reading old posts.On the other hand, it will automatically scroll to the bottom on a "new message" event (in this demo, on button's click event).
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
.content {
@simonewebdesign
simonewebdesign / fullscreen.js
Last active September 28, 2023 04:23
go fullscreen on click (cross-browser) - with a single button
$('.fullscreenbutton').on('click', function () {
function toggleFullScreen() {
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
<button id="btn">Click me!</button>
<script>
var btn = document.getElementById('btn');
btn.onclick = function() {
// will be overwritten!
console.log('[onclick] foo');
}
@simonewebdesign
simonewebdesign / main.rb
Created September 19, 2022 18:32
Ruby script that updates all issues on a repo. You can use it to close all issues at once, for example. Uses the GitHub API via Octokit.rb.
require 'octokit'
client = Octokit::Client.new access_token: ENV['MY_GITHUB_PERSONAL_TOKEN']
client.auto_paginate = true
repo = 'ORG_NAME/REPO_NAME'
issues = client.issues repo
puts "Repo #{repo} has #{issues.length} issues."
@simonewebdesign
simonewebdesign / index.html
Last active August 16, 2022 21:51
Play WAV and MP3 files with HTML5 Audio
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>audio test</title>
</head>
<body>
<!-- <audio controls="controls" autoplay>
Your browser does not support the <code>audio</code> element.
<source src="smb_gameover.wav" type="audio/wav">
@simonewebdesign
simonewebdesign / js_libs.md
Created December 16, 2014 16:19
JavaScript libraries
@simonewebdesign
simonewebdesign / README.md
Last active March 3, 2022 12:11
Easy Search & Replace on an entire file (or STDIN) using sed

Even better is probably to have a script.sh file which looks like this (same thing but more readable):

#!/bin/bash
sed "s/FNAME/Simone/g;\
     s/LNAME/Vittori/g;\
     s/EMAIL/myemail@foobar.com/g;"

Just chmod +x script.sh and then use it like: