Skip to content

Instantly share code, notes, and snippets.

View kyleridolfo's full-sized avatar

Kyle Ridolfo kyleridolfo

View GitHub Profile
@kyleridolfo
kyleridolfo / big.json
Created March 19, 2023 14:53
big.json example
{"currentWeather":{"asOf":"2023-03-18T12:40:33Z","cloudCover":0.64,"cloudCoverHighAltPct":0.75,"cloudCoverLowAltPct":0.11,"cloudCoverMidAltPct":0.08,"conditionCode":"MostlyCloudy","daylight":true,"humidity":0.67,"metadata":{"attributionURL":"https://weatherkit.apple.com/legal-attribution.html","expireTime":"2023-03-18T12:45:33Z","latitude":42.384,"longitude":-72.652,"readTime":"2023-03-18T12:40:33Z","reportedTime":"2023-03-18T11:00:00Z","units":"m","version":1},"name":"CurrentWeather","precipitationIntensity":0.0,"pressure":1006.01,"pressureTrend":"rising","temperature":2.72,"temperatureApparent":-0.27,"temperatureDewPoint":-2.76,"uvIndex":1,"visibility":27870.37,"windDirection":324,"windGust":31.41,"windSpeed":10.88},"forecastDaily":{"days":[{"conditionCode":"PartlyCloudy","daytimeForecast":{"cloudCover":0.42,"conditionCode":"PartlyCloudy","forecastEnd":"2023-03-19T00:00:00Z","forecastStart":"2023-03-18T12:00:00Z","humidity":0.59,"precipitationAmount":0.0,"precipitationChance":0.0,"precipitationType":"clear"
@kyleridolfo
kyleridolfo / README.md
Created February 12, 2018 19:45 — forked from Snugug/README.md
Progressively Enhanced Lazy Loading Images in 40 lines of code

Lazy Load Images in 40 Lines of Code

Behold! Intersection Observers at work!

Usage

First, update your source code to move your image sources in to data attributes.

@kyleridolfo
kyleridolfo / config.php
Created July 19, 2017 15:18 — forked from jarektkaczyk/config.php
Laravel - tinker like a boss (with PsySH)
<?php // ~/.config/psysh/config.php
// Anything not Laravel - let's try to autoload something likely to exist
if (!defined('LARAVEL_START')) {
return [
'defaultIncludes' => [
getcwd().'/vendor/autoload.php',
getcwd().'/bootstrap/autoload.php',
],
];
/* the page should not change width as content is loaded */
body {
overflow-y: scroll;
}
/* block scrolling without losing the scroll bar and shifting the page */
/* add this class when a modal is open */
body.block-scroll {
overflow: hidden;
overflow-y: scroll !important;
@kyleridolfo
kyleridolfo / birthdays.php
Created February 7, 2017 02:18 — forked from paulofreitas/birthdays.php
Working with birthdays using Carbon
<?php
/*
* HOW TO TEST:
* composer require illuminate/support nestbot/carbon fzaninotto/faker
*/
require 'vendor/autoload.php';
date_default_timezone_set('America/Sao_Paulo');
header('Content-Type: text/plain');
@kyleridolfo
kyleridolfo / UuidModel.php
Created October 11, 2016 17:55 — forked from danb-humaan/UuidModel.php
Trait for implementing UUIDs in Laravel models
<?php
namespace App\Traits;
use Rhumsaa\Uuid\Uuid;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Trait UuidModel
* @package App\Traits
@kyleridolfo
kyleridolfo / gist:179ffc5471d34d477c9042c637c9533f
Created May 20, 2016 21:28 — forked from dfinzer/gist:8059ce0b43c476fcb986e8b3096aeafd
Command for creating new aliases from the previous command
new-alias() {
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //')
echo alias $1="'""$last_command""'" >> ~/.bash_profile
. ~/.bash_profile
}
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php70-tidy/tidy.so' - dlopen(/usr/local/opt/php70-tidy/tidy.so, 9): Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib
Referenced from: /usr/local/opt/php70-tidy/tidy.so
Reason: image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php70-tidy/tidy.so' - dlopen(/usr/local/opt/php70-tidy/tidy.so, 9): Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib
Referenced from: /usr/local/opt/php70-tidy/tidy.so
Reason: image not found in Unknown on line 0
PHP 7.0.1 (cli) (built: Dec 18 2015 19:20:08) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
@kyleridolfo
kyleridolfo / brew-doctor.txt
Created January 6, 2016 15:32
Brew doctor output
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
php56
@kyleridolfo
kyleridolfo / output.txt
Created January 6, 2016 15:31
php70-tidy output
$ brew install -v /usr/local/Library/Taps/homebrew/homebrew-php/Formula/php70-tidy.rb
==> Installing php70-tidy from homebrew/php
==> Downloading https://homebrew.bintray.com/bottles-php/php70-tidy-7.0.1.el_capitan.bottle.9.tar.gz
Already downloaded: /Library/Caches/Homebrew/php70-tidy-7.0.1.el_capitan.bottle.9.tar.gz
==> Verifying php70-tidy-7.0.1.el_capitan.bottle.9.tar.gz checksum
==> Pouring php70-tidy-7.0.1.el_capitan.bottle.9.tar.gz
tar xvf /Library/Caches/Homebrew/php70-tidy-7.0.1.el_capitan.bottle.9.tar.gz
x php70-tidy/7.0.1/
x php70-tidy/7.0.1/.bottle/
x php70-tidy/7.0.1/INSTALL_RECEIPT.json