Skip to content

Instantly share code, notes, and snippets.

View alessandroraffa's full-sized avatar
💻
Coding

Alessandro Raffa alessandroraffa

💻
Coding
View GitHub Profile
/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
@vitorbritto
vitorbritto / rm_mysql.md
Last active January 23, 2026 02:17
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@MakingJamie
MakingJamie / in_viewport.js
Created January 27, 2014 10:19
check if element is in viewport - vanilla JS. Use by adding a “scroll” event listener to the window and then calling isInViewport().
// Determine if an element is in the visible viewport
function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
);
@david4096
david4096 / index.html
Last active June 1, 2016 17:11
Collapsible Force Layout, collapsed by default
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link type="text/css" rel="stylesheet" href="style.css"/>
<style type="text/css">
circle.node {
cursor: pointer;
stroke: #000;
@justo
justo / mqs.css
Last active December 19, 2015 21:59
Simple CSS3 Media Queries
/* Justin's simple CSS3 media queries (not mobile-first) */
/* Desktops */
@media only screen and (min-width : 1024px) {
}
/* Tablets */
@media only screen and (min-width : 641px) and (max-width : 1024px) {
@magnetikonline
magnetikonline / README.md
Last active October 29, 2025 21:22
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
/* iPad In Portrait & Landscape */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {}
/* iPad In Landscape */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {}
/* iPad In Portrait */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {}
/* Retina Display iPads */
@antonmedv
antonmedv / DotNotation.php
Last active August 11, 2022 13:47
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@digitaljhelms
digitaljhelms / gist:4287848
Last active February 6, 2026 16:55
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch