This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########## | |
| # This is a script I wrote as an AWS lambda function to read sensor data from a Nest and set my Sensibo accordingly | |
| # The API clients are written by me as well and are available at | |
| # https://github.com/ehowe/sensibo-api and https://github.com/ehowe/nest-api | |
| # but can also be installed with `gem install sensibo-api` and `gem install nest-api`. | |
| # The lambda function requires 2 environment variables `API_KEY` for the Sensibo API and `ACCESS_TOKEN` for the Nest API. | |
| # Those API keys will need to be generated in the appropriate developer consoles. | |
| # After creating the Lambda function, you can create a scheduled task in CloudWatch to run the function at whatever interval | |
| # you choose. Mine is set at 15 minutes. | |
| # The function will send all output to CloudWatch as well, which you can act on if you choose. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let mix = require('laravel-mix'); | |
| mix.js('src/index.js', 'dist/foo.js').sourceMaps(); | |
| mix.webpackConfig({ | |
| output: { | |
| libraryTarget: 'umd', | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Class LocalValetDriver | |
| * | |
| * This class demonstrates how we might go about proxying any missing local images to a remote host. i.e; the production | |
| * site. This has been created with WordPress in mind but could be adjusted to work with any other system. | |
| */ | |
| class LocalValetDriver extends WordPressValetDriver { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function chain($object) | |
| { | |
| return new class ($object) { | |
| protected $lastReturn = null; | |
| public function __construct($object) | |
| { | |
| $this->wrapped = $object; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class FieldServiceProvider extends ServiceProvider{ | |
| /** | |
| * Bootstrap the field services. | |
| * @return void | |
| */ | |
| public function boot() | |
| { | |
| Nova::serving(function (ServingNova $event) { | |
| $files = app('files'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Take Accent color, and convert it to RGBA, and add an opacity of .75. | |
| */ | |
| $accent = get_theme_mod( 'site_accent_color' ); | |
| $accent_string = ltrim( $accent, '#' ); | |
| $arr = str_split( $accent_string, '2' ); | |
| foreach ( $arr as $value ) { | |
| $new_value = hexdec( $value ) . ', '; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Notes: Special Thanks to OleMartinOrg (https://stackoverflow.com/users/2677898/olemartinorg) | |
| //StackOverflow Source: https://stackoverflow.com/questions/5312349/minifying-final-html-output-using-regular-expressions-with-codeigniter. | |
| //Usage: Place code below in new ViewServiceProvider that's registered after the Laravel version: | |
| //$this->app->singleton('blade.compiler', function () { | |
| // return new HtmlMinifyCompiler($this->app['files'], $this->app['config']['view.compiled']); | |
| //}); | |
| //$this->app['view']->getEngineResolver()->register('blade', function () { | |
| // return new CompilerEngine($this->app['blade.compiler']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require __DIR__ . '/vendor/autoload.php'; | |
| use GuzzleHttp\Client; | |
| $url = "https://domain.tld/large-file.mp4"; | |
| $tmpFile = tempnam(sys_get_temp_dir(), 'guzzle-download'); | |
| $client = new Client(array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # FORGE CONFIG (DOT NOT REMOVE!) | |
| include forge-conf/sitio.com/before/*; | |
| server { | |
| listen 443 ssl http2; | |
| listen [::]:443 ssl http2; | |
| server_name sitio.com; | |
| root /home/forge/sitio.com/public; | |
| # FORGE SSL (DO NOT REMOVE!) |