Skip to content

Instantly share code, notes, and snippets.

Avatar
🐝
beeing busy

spaceemotion

🐝
beeing busy
View GitHub Profile
@spaceemotion
spaceemotion / browser.js
Created Jul 23, 2020
Custom Browsershot browser.js to run on AWS Lambda via Laravel Vapor
View browser.js
const chromium = require('chrome-aws-lambda');
const fs = require('fs');
const URL = require('url').URL;
const URLParse = require('url').parse;
const [, , ...args] = process.argv;
/**
* There are two ways for Browsershot to communicate with puppeteer:
@spaceemotion
spaceemotion / DatabaseServiceProvider.php
Created Jul 22, 2018
Adds a "chunkSimple" method to Laravel's query builder, so where(Has) clauses don't break with pagination. This might happen if you update the same model in the chunk callback, thus skipping rows. Simply swap out chunk with chunkSimple and hey, presto!
View DatabaseServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
class DatabaseServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
@spaceemotion
spaceemotion / _border-utilities.scss
Last active Jun 4, 2018
Responsive Border Utilities for Bootstrap 4.1
View _border-utilities.scss
// stylelint-disable declaration-no-important
//
// Border
//
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@spaceemotion
spaceemotion / EditorWindowFinder.cs
Created Mar 28, 2017
Displays a window that lists all available EditorWindows inside the Unity Editor.
View EditorWindowFinder.cs
using System;
using System.Reflection;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class EditorWindowFinder : EditorWindow
{
View OcclusionBase.cs
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OcclusionBase : MonoBehaviour {
public bool isVisible { get; set; }
public DateTime lastSeen { get; set; }
}
@spaceemotion
spaceemotion / pinterest-classic.css
Created Jul 28, 2016
Pinterest "Classic Style" - UserStyle
View pinterest-classic.css
.UserProfilePage .secretBoardWrapper .Board.boardCoverImage {
background: #fff !important;
}
.Board.boardCoverImage, .Pin.summary:not(.exploreTabPin) {
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.22) !important;
background: #fff !important;
}
.pinCredits {